mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix(PluginManager): re-aggregate old and current manifests in DetectAvailablePluginUpdates() (closes #409)
This commit is contained in:
parent
bacf4d8400
commit
efdadc6c35
1 changed files with 12 additions and 1 deletions
|
|
@ -800,15 +800,24 @@ namespace Dalamud.Plugin.Internal
|
|||
{
|
||||
var updatablePlugins = new List<AvailablePluginUpdate>();
|
||||
|
||||
if (!this.ReposReady)
|
||||
throw new Exception("Plugin updates can only be detected when repos are available.");
|
||||
|
||||
// Collect all outdated and current plugin manifests
|
||||
var remoteManifests =
|
||||
this.Repos.SelectMany(x => x.PluginMaster).Where(x => x.DalamudApiLevel <= DalamudApiLevel).ToList();
|
||||
|
||||
for (var i = 0; i < this.installedPlugins.Count; i++)
|
||||
{
|
||||
var plugin = this.installedPlugins[i];
|
||||
|
||||
Log.Debug($"Checking plugin updates for {plugin.Manifest.InternalName}");
|
||||
|
||||
var installedVersion = plugin.IsTesting
|
||||
? plugin.Manifest.TestingAssemblyVersion
|
||||
: plugin.Manifest.AssemblyVersion;
|
||||
|
||||
var updates = this.availablePlugins
|
||||
var updates = remoteManifests
|
||||
.Where(remoteManifest => plugin.Manifest.InternalName == remoteManifest.InternalName)
|
||||
.Select(remoteManifest =>
|
||||
{
|
||||
|
|
@ -818,6 +827,8 @@ namespace Dalamud.Plugin.Internal
|
|||
: remoteManifest.AssemblyVersion;
|
||||
var isUpdate = candidateVersion > installedVersion;
|
||||
|
||||
Log.Debug($" => {remoteManifest.InternalName} from {remoteManifest.SourceRepo.PluginMasterUrl} - candidate: {candidateVersion} installed: {installedVersion}");
|
||||
|
||||
return (isUpdate, useTesting, candidateVersion, remoteManifest);
|
||||
})
|
||||
.Where(tpl => tpl.isUpdate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue