diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-06-03 19:48:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-03 19:48:37 +0200 |
| commit | 21c0a35edfd7d1dd80fd71c511a581fd0f6ea2f5 (patch) | |
| tree | 52396db4302f3f0fdeea84247c718178c1ec2d81 | |
| parent | cf88058099d4c63f3b11b8f0e486f8f9552c354a (diff) | |
| parent | 285fc1b9f614302742413d0f2a51f9d28c401401 (diff) | |
Fix season unknown for flat TV structures
| -rw-r--r-- | MediaBrowser.Providers/TV/SeriesMetadataService.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/MediaBrowser.Providers/TV/SeriesMetadataService.cs b/MediaBrowser.Providers/TV/SeriesMetadataService.cs index 61a31fbfd6..078c396730 100644 --- a/MediaBrowser.Providers/TV/SeriesMetadataService.cs +++ b/MediaBrowser.Providers/TV/SeriesMetadataService.cs @@ -210,16 +210,19 @@ public class SeriesMetadataService : MetadataService<Series, SeriesInfo> return true; } - // Not yet processed - if (episode.SeasonId.IsEmpty()) + // Episode has been processed and linked to a season, only needs a virtual season + // if it isn't already linked to a known physical season by ID or path + if (!episode.SeasonId.IsEmpty()) { - return false; + return !physicalSeasonIds.Contains(episode.SeasonId) + && !physicalSeasonPaths.Contains(System.IO.Path.GetDirectoryName(episode.Path) ?? string.Empty); } - // Episode has been processed, only needs a virtual season if it isn't - // already linked to a known physical season by ID or path - return !physicalSeasonIds.Contains(episode.SeasonId) - && !physicalSeasonPaths.Contains(System.IO.Path.GetDirectoryName(episode.Path) ?? string.Empty); + // Episode not yet linked, check if it's in a physical season folder + // If yes then skip it, processing not finished + // If no then include it, needs Season Unknown + var episodeDirectory = System.IO.Path.GetDirectoryName(episode.Path) ?? string.Empty; + return !physicalSeasonPaths.Contains(episodeDirectory); } /// <summary> |
