mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: display 3pp changelogs
This commit is contained in:
parent
bea7ab56b1
commit
d7c510647e
2 changed files with 33 additions and 6 deletions
|
|
@ -7,6 +7,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using Dalamud.Plugin.Internal;
|
||||
using Dalamud.Utility;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.PluginInstaller;
|
||||
|
|
@ -49,17 +50,29 @@ internal class DalamudChangelogManager
|
|||
|
||||
foreach (var plugin in this.manager.InstalledPlugins)
|
||||
{
|
||||
if (plugin.Manifest.IsThirdParty || !plugin.Manifest.IsDip17Plugin)
|
||||
continue;
|
||||
if (!plugin.Manifest.IsThirdParty)
|
||||
{
|
||||
if (!plugin.Manifest.IsDip17Plugin)
|
||||
continue;
|
||||
|
||||
var pluginChangelogs = await client.GetFromJsonAsync<PluginHistory>(string.Format(
|
||||
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 = changelogs.Concat(pluginChangelogs.Versions
|
||||
.Where(x => x.Dip17Track == plugin.Manifest.Dip17Channel)
|
||||
.Select(x => new PluginChangelogEntry(plugin, x)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plugin.Manifest.Changelog.IsNullOrWhitespace())
|
||||
continue;
|
||||
|
||||
changelogs = changelogs.Append(new PluginChangelogEntry(plugin));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.Changelogs = changelogs.OrderByDescending(x => x.Date).ToList();
|
||||
|
|
|
|||
|
|
@ -25,6 +25,20 @@ internal class PluginChangelogEntry : IChangelogEntry
|
|||
this.Date = history.PublishedAt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginChangelogEntry"/> class.
|
||||
/// </summary>
|
||||
/// <param name="plugin">The plugin manifest.</param>
|
||||
public PluginChangelogEntry(LocalPlugin plugin)
|
||||
{
|
||||
this.Plugin = plugin;
|
||||
|
||||
this.Version = plugin.Manifest.EffectiveVersion.ToString();
|
||||
this.Text = plugin.Manifest.Changelog ?? Loc.Localize("ChangelogNoText", "No changelog for this version.");
|
||||
this.Author = plugin.Manifest.Author;
|
||||
this.Date = DateTimeOffset.FromUnixTimeSeconds(this.Plugin.Manifest.LastUpdate).DateTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the respective plugin.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue