mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-18 21:50:25 +01:00
Apply review feedback
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Emby.Naming.TV
|
||||
/// Regex that matches titles with year in parentheses. Captures the title (which may be
|
||||
/// numeric) before the year, i.e. turns "1923 (2022)" into "1923".
|
||||
/// </summary>
|
||||
[GeneratedRegex(@"(?<title>.+?)\s*\((?<year>\d{4})\)")]
|
||||
[GeneratedRegex(@"(?<title>.+?)\s*\((?<year>[0-9]{4})\)")]
|
||||
private static partial Regex TitleWithYearRegex();
|
||||
|
||||
/// <summary>
|
||||
@@ -44,7 +44,7 @@ namespace Emby.Naming.TV
|
||||
return new SeriesInfo(path)
|
||||
{
|
||||
Name = seriesName,
|
||||
Year = int.TryParse(titleWithYearMatch.Groups["year"].Value, out var year) ? year : null
|
||||
Year = int.TryParse(titleWithYearMatch.Groups["year"].ValueSpan, out var year) ? year : null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user