aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-08-03 15:29:32 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-08-03 15:29:32 +0200
commitf502fd312e5f807264c4e18a216d5309cd5a7015 (patch)
treea2578e26943254760b54fc6929d7027868676ff7
parent4e2089b6a18c323c6c3d158aeba87098ff400450 (diff)
Fix test
-rw-r--r--tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs b/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs
index 240f6742da..e34eb0bda3 100644
--- a/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs
+++ b/tests/Jellyfin.Controller.Tests/Entities/BaseItemTests.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
@@ -329,20 +330,24 @@ public class BaseItemTests
[Theory]
// The season folder is the season's own, so the extras that sit in it are the season's. Whether
// the season holds one episode or two must not decide where its extras show up.
- [InlineData("/TV/Show/Season 1/S01E01 - 1080p.mkv", false)]
+ [InlineData(false, false)]
// An episode with a folder of its own keeps the extras in it, as nothing else searches there
- [InlineData("/TV/Show/Season 1/S01E01/S01E01 - 1080p.mkv", true)]
- public async Task RefreshedOwnedItems_EpisodeInAContainersOwnFolder_LeavesExtrasToTheContainer(string episodePath, bool expectSearch)
+ [InlineData(true, true)]
+ public async Task RefreshedOwnedItems_EpisodeInAContainersOwnFolder_LeavesExtrasToTheContainer(bool episodeHasOwnFolder, bool expectSearch)
{
+ var seasonPath = Path.Combine("TV", "Show", "Season 1");
+ var episodeFolder = episodeHasOwnFolder ? Path.Combine(seasonPath, "S01E01") : seasonPath;
+ var episodePath = Path.Combine(episodeFolder, "S01E01 - 1080p.mkv");
+
// The season needs a parent of its own, as an item without one maintains no owned items
- var season = new Season { Id = Guid.NewGuid(), ParentId = Guid.NewGuid(), Path = "/TV/Show/Season 1" };
+ var season = new Season { Id = Guid.NewGuid(), ParentId = Guid.NewGuid(), Path = seasonPath };
var episode = new Episode
{
Id = Guid.NewGuid(),
ParentId = season.Id,
Path = episodePath,
// A version file is what makes an episode maintain owned items at all
- LocalAlternateVersions = [episodePath.Replace("1080p", "720p", StringComparison.Ordinal)]
+ LocalAlternateVersions = [Path.Combine(episodeFolder, "S01E01 - 720p.mkv")]
};
var mediaSourceManager = new Mock<IMediaSourceManager>();