Rework season folder parsing (#11748)

This commit is contained in:
Tim Eisele
2025-03-23 17:05:40 +01:00
committed by GitHub
parent 8db6a39e92
commit dfb485d1f2
7 changed files with 105 additions and 92 deletions

View File

@@ -2512,8 +2512,11 @@ namespace Emby.Server.Implementations.Library
}
/// <inheritdoc />
public int? GetSeasonNumberFromPath(string path)
=> SeasonPathParser.Parse(path, true, true).SeasonNumber;
public int? GetSeasonNumberFromPath(string path, Guid? parentId)
{
var parentPath = parentId.HasValue ? GetItemById(parentId.Value)?.ContainingFolderPath : null;
return SeasonPathParser.Parse(path, parentPath, true, true).SeasonNumber;
}
/// <inheritdoc />
public bool FillMissingEpisodeNumbersFromPath(Episode episode, bool forceRefresh)