fix: don't try to load changelogs for dev plugins, show changelogs that loaded if any failed

This commit is contained in:
goat 2023-08-12 12:04:22 +02:00
parent bfbfe8c918
commit 593b338a26
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
3 changed files with 28 additions and 11 deletions

View file

@ -241,6 +241,7 @@ internal class TextureManager : IDisposable, IServiceType, ITextureSubstitutionP
if (!this.activeTextures.TryGetValue(path, out var info) || info == null)
continue;
info.Wrap?.Dispose();
info.Wrap = null;
}
}

View file

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal;
using Dalamud.Utility;
using Serilog;
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
@ -44,27 +45,35 @@ internal class DalamudChangelogManager
this.Changelogs = null;
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)
{
if (!plugin.IsThirdParty)
if (!plugin.IsThirdParty && !plugin.IsDev)
{
var pluginChangelogs = await client.GetFromJsonAsync<PluginHistory>(string.Format(
PluginChangelogUrl,
plugin.Manifest.InternalName,
plugin.Manifest.Dip17Channel));
try
{
var pluginChangelogs = await client.GetFromJsonAsync<PluginHistory>(string.Format(
PluginChangelogUrl,
plugin.Manifest.InternalName,
plugin.Manifest.Dip17Channel));
changelogs = changelogs.Concat(pluginChangelogs.Versions
.Where(x => x.Dip17Track == plugin.Manifest.Dip17Channel)
.Select(x => new PluginChangelogEntry(plugin, x)));
changelogs.AddRange(pluginChangelogs.Versions
.Where(x => x.Dip17Track ==
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
{
if (plugin.Manifest.Changelog.IsNullOrWhitespace())
continue;
changelogs = changelogs.Append(new PluginChangelogEntry(plugin));
changelogs.Add(new PluginChangelogEntry(plugin));
}
}

View file

@ -967,7 +967,14 @@ internal class PluginInstallerWindow : Window, IDisposable
{
this.dalamudChangelogRefreshTaskCts = new CancellationTokenSource();
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;