mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
fix: don't try to load changelogs for dev plugins, show changelogs that loaded if any failed
This commit is contained in:
parent
bfbfe8c918
commit
593b338a26
3 changed files with 28 additions and 11 deletions
|
|
@ -241,6 +241,7 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP
|
||||||
if (!this.activeTextures.TryGetValue(path, out var info) || info == null)
|
if (!this.activeTextures.TryGetValue(path, out var info) || info == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
info.Wrap?.Dispose();
|
||||||
info.Wrap = null;
|
info.Wrap = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||||
using Dalamud.Networking.Http;
|
using Dalamud.Networking.Http;
|
||||||
using Dalamud.Plugin.Internal;
|
using Dalamud.Plugin.Internal;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
|
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
|
||||||
|
|
||||||
|
|
@ -44,27 +45,35 @@ internal class DalamudChangelogManager
|
||||||
this.Changelogs = null;
|
this.Changelogs = null;
|
||||||
|
|
||||||
var dalamudChangelogs = await client.GetFromJsonAsync<List<DalamudChangelog>>(DalamudChangelogUrl);
|
var dalamudChangelogs = await client.GetFromJsonAsync<List<DalamudChangelog>>(DalamudChangelogUrl);
|
||||||
var changelogs = dalamudChangelogs.Select(x => new DalamudChangelogEntry(x)).Cast<IChangelogEntry>();
|
var changelogs = dalamudChangelogs.Select(x => new DalamudChangelogEntry(x)).Cast<IChangelogEntry>().ToList();
|
||||||
|
|
||||||
foreach (var plugin in this.manager.InstalledPlugins)
|
foreach (var plugin in this.manager.InstalledPlugins)
|
||||||
{
|
{
|
||||||
if (!plugin.IsThirdParty)
|
if (!plugin.IsThirdParty && !plugin.IsDev)
|
||||||
{
|
{
|
||||||
var pluginChangelogs = await client.GetFromJsonAsync<PluginHistory>(string.Format(
|
try
|
||||||
PluginChangelogUrl,
|
{
|
||||||
plugin.Manifest.InternalName,
|
var pluginChangelogs = await client.GetFromJsonAsync<PluginHistory>(string.Format(
|
||||||
plugin.Manifest.Dip17Channel));
|
PluginChangelogUrl,
|
||||||
|
plugin.Manifest.InternalName,
|
||||||
|
plugin.Manifest.Dip17Channel));
|
||||||
|
|
||||||
changelogs = changelogs.Concat(pluginChangelogs.Versions
|
changelogs.AddRange(pluginChangelogs.Versions
|
||||||
.Where(x => x.Dip17Track == plugin.Manifest.Dip17Channel)
|
.Where(x => x.Dip17Track ==
|
||||||
.Select(x => new PluginChangelogEntry(plugin, x)));
|
plugin.Manifest.Dip17Channel)
|
||||||
|
.Select(x => new PluginChangelogEntry(plugin, x)));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error(ex, "Failed to load changelog for {PluginName}", plugin.Manifest.Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (plugin.Manifest.Changelog.IsNullOrWhitespace())
|
if (plugin.Manifest.Changelog.IsNullOrWhitespace())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
changelogs = changelogs.Append(new PluginChangelogEntry(plugin));
|
changelogs.Add(new PluginChangelogEntry(plugin));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -967,7 +967,14 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
this.dalamudChangelogRefreshTaskCts = new CancellationTokenSource();
|
this.dalamudChangelogRefreshTaskCts = new CancellationTokenSource();
|
||||||
this.dalamudChangelogRefreshTask =
|
this.dalamudChangelogRefreshTask =
|
||||||
Task.Run(this.dalamudChangelogManager.ReloadChangelogAsync, this.dalamudChangelogRefreshTaskCts.Token);
|
Task.Run(this.dalamudChangelogManager.ReloadChangelogAsync, this.dalamudChangelogRefreshTaskCts.Token)
|
||||||
|
.ContinueWith(t =>
|
||||||
|
{
|
||||||
|
if (!t.IsCompletedSuccessfully)
|
||||||
|
{
|
||||||
|
Log.Error(t.Exception, "Failed to load changelogs.");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue