fix library scanning with non-english season folder names (#1222)

This commit is contained in:
Jason Dove
2023-03-31 13:37:54 -05:00
committed by GitHub
parent aa87abc53d
commit 721f0df82a
3 changed files with 9 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix updating (re-adding) Trakt lists to properly use new metadata ids that were not present when originally added
- Fix local show library scanning with non-english season folder names, e.g. `Staffel 02`
### Changed
- Use Poster artwork for XMLTV if available
@@ -155,6 +155,8 @@ public class FallbackMetadataProviderTests
[TestCase(@"/Whatever/American Dad! S01", 1)]
[TestCase(@"/Whatever/Season 2", 2)]
[TestCase(@"/Whatever/Season 02", 2)]
[TestCase(@"/Whatever/Staffel 2", 2)]
[TestCase(@"/Whatever/Staffel 02", 2)]
[TestCase(@"/Whatever/Seinfeld/S02", 2)]
[TestCase(@"/Whatever/Seinfeld/2", 2)]
[TestCase(@"/Whatever/Season 2009", 2009)]
@@ -19,13 +19,18 @@ public partial class FallbackMetadataProvider : IFallbackMetadataProvider
{
return seasonNumber;
}
Match match = SeasonPattern.Match(folderName);
if (match.Success && int.TryParse(match.Groups[1].Value, out seasonNumber))
{
return seasonNumber;
}
if (int.TryParse(folder.Split(" ").Last(), out seasonNumber))
{
return seasonNumber;
}
if (folder.EndsWith("specials", StringComparison.OrdinalIgnoreCase))
{
return 0;