aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2026-09-07 17:43:57 -0400
committerGitHub <noreply@github.com>2026-09-07 17:43:57 -0400
commit42f7a6e720bd047a2ec84ea21434bec5f1eebaa0 (patch)
tree04fb58f58d8761f714b2358511c5e4b0f9b6b760 /tests
parent96f81b0c1bf2d517c6efb3cd29821f90f29cf5e4 (diff)
parente1e319cb5c5bf3ccfd8a6a81ab616aa05299522b (diff)
Merge pull request #17820 from Shadowghost/only-download-missing-plugin-images
Only download missing plugin images
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
index 265b6a7f43..ee41b968e1 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs
@@ -240,6 +240,28 @@ namespace Jellyfin.Server.Implementations.Tests.Plugins
}
[Fact]
+ public async Task PopulateManifest_ExistingImage_IsNotDownloaded()
+ {
+ const string ImageContent = "not really a png";
+
+ var packageInfo = GenerateTestPackage();
+ packageInfo.ImageUrl = "https://example.org/some-plugin.png";
+
+ var imagePath = Path.Combine(_pluginPath, "some-plugin.png");
+ await File.WriteAllTextAsync(imagePath, ImageContent, TestContext.Current.CancellationToken);
+
+ // The application host is null, so attempting to download the image would throw.
+ var pluginManager = new PluginManager(new NullLogger<PluginManager>(), null!, null!, null!, new Version(1, 0));
+
+ Assert.True(await pluginManager.PopulateManifest(packageInfo, new Version(1, 0), _pluginPath, PluginStatus.Active));
+
+ var result = pluginManager.LoadManifest(_pluginPath).Manifest;
+
+ Assert.Equal(imagePath, result.ImagePath);
+ Assert.Equal(ImageContent, await File.ReadAllTextAsync(imagePath, TestContext.Current.CancellationToken));
+ }
+
+ [Fact]
public async Task PopulateManifest_ExistingMetafileMismatchedIds_Status_Malfunctioned()
{
var packageInfo = GenerateTestPackage();