Merge pull request #16995 from theguymadmax/fix-flat-series
Some checks failed
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
Format / format-check (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Artifact (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled

Fix season unknown for flat TV structures
This commit is contained in:
Bond-009
2026-06-03 19:48:37 +02:00
committed by GitHub

View File

@@ -210,16 +210,19 @@ public class SeriesMetadataService : MetadataService<Series, SeriesInfo>
return true; return true;
} }
// Not yet processed // Episode has been processed and linked to a season, only needs a virtual season
if (episode.SeasonId.IsEmpty()) // 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 // Episode not yet linked, check if it's in a physical season folder
// already linked to a known physical season by ID or path // If yes then skip it, processing not finished
return !physicalSeasonIds.Contains(episode.SeasonId) // If no then include it, needs Season Unknown
&& !physicalSeasonPaths.Contains(System.IO.Path.GetDirectoryName(episode.Path) ?? string.Empty); var episodeDirectory = System.IO.Path.GetDirectoryName(episode.Path) ?? string.Empty;
return !physicalSeasonPaths.Contains(episodeDirectory);
} }
/// <summary> /// <summary>