aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKefia-02 <yoshimtsu4432@gmail.com>2026-11-29 19:01:43 +0900
committerGitHub <noreply@github.com>2026-11-29 11:01:43 +0100
commitce2884c0efbe3e973d757504a418900fc83671b5 (patch)
treee9ed51d1072cbfb432f2884849cb99037b548557
parent51a3e2d462f9417ab9302b07e220b3eceb503143 (diff)
Fix superseded plugins being reactivated during catalog refresh (#18773)HEADmaster
* fix(plugins): preserve superseded status during catalog refresh * fix(plugins): exclude superseded versions from update candidates * test(plugins): cover superseded status after catalog refresh
-rw-r--r--Emby.Server.Implementations/Plugins/PluginManager.cs2
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs4
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs22
3 files changed, 25 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs
index f7ad9b9498..392493264c 100644
--- a/Emby.Server.Implementations/Plugins/PluginManager.cs
+++ b/Emby.Server.Implementations/Plugins/PluginManager.cs
@@ -415,7 +415,7 @@ namespace Emby.Server.Implementations.Plugins
TargetAbi = versionInfo.TargetAbi ?? string.Empty,
Timestamp = string.IsNullOrEmpty(versionInfo.Timestamp) ? DateTime.MinValue : DateTime.Parse(versionInfo.Timestamp, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal),
Version = versionInfo.Version,
- Status = status == PluginStatus.Disabled ? PluginStatus.Disabled : PluginStatus.Active, // Keep disabled state.
+ Status = status is PluginStatus.Disabled or PluginStatus.Superseded ? status : PluginStatus.Active, // Keep disabled and superseded states.
AutoUpdate = true,
ImagePath = imagePath
};
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index cccdb3e6aa..8fd4b83e78 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -503,9 +503,9 @@ namespace Emby.Server.Implementations.Updates
var plugins = _pluginManager.Plugins;
foreach (var plugin in plugins)
{
- // Don't auto update when plugin marked not to, or when it's disabled or pending removal.
+ // Don't auto update when plugin marked not to, or when it's disabled, superseded or pending removal.
if (plugin.Manifest?.AutoUpdate == false
- || plugin.Manifest?.Status is PluginStatus.Disabled or PluginStatus.Deleted)
+ || plugin.Manifest?.Status is PluginStatus.Disabled or PluginStatus.Superseded or PluginStatus.Deleted)
{
continue;
}
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
index ee41b968e1..9c50c5b1ac 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
@@ -239,6 +239,28 @@ namespace Jellyfin.Server.Implementations.Tests.Plugins
Assert.Equivalent(expectedManifest, result);
}
+ [Theory]
+ [InlineData(PluginStatus.Active)]
+ [InlineData(PluginStatus.Disabled)]
+ [InlineData(PluginStatus.Superseded)]
+ public async Task PopulateManifest_CatalogRefresh_PreservesPersistedStatus(PluginStatus status)
+ {
+ var packageInfo = GenerateTestPackage();
+ var pluginManager = new PluginManager(new NullLogger<PluginManager>(), null!, null!, null!, new Version(1, 0));
+ var manifest = new PluginManifest
+ {
+ Id = packageInfo.Id,
+ Name = packageInfo.Name,
+ Version = packageInfo.Versions[0].Version,
+ Status = status
+ };
+
+ Assert.True(pluginManager.SaveManifest(manifest, _pluginPath));
+ Assert.True(await pluginManager.PopulateManifest(packageInfo, new Version(1, 0), _pluginPath, status));
+
+ Assert.Equal(status, pluginManager.LoadManifest(_pluginPath).Manifest.Status);
+ }
+
[Fact]
public async Task PopulateManifest_ExistingImage_IsNotDownloaded()
{