Allow any language for season guessing

Signed-off-by: gnattu <gnattuoc@me.com>
pull/11472/head
gnattu 2 weeks ago
parent 4e22612c91
commit 14845a9736

@ -204,7 +204,9 @@ namespace MediaBrowser.Providers.TV
var seasonNames = series.SeasonNames;
var seriesChildren = series.GetRecursiveChildren(i => i is Episode || i is Season);
var seasons = seriesChildren.OfType<Season>().ToList();
foreach (var season in seasons.Where(season => season.IndexNumber is null).Where(season => season.Name.Contains("season", StringComparison.InvariantCultureIgnoreCase)))
// Very old Jellyfin library will have a cursed DB that a season may have NULL index number
foreach (var season in seasons.Where(season => season.IndexNumber is null).Where(season => season.Name.Any(char.IsDigit)))
{
season.IndexNumber = int.Parse(new string(season.Name.Where(char.IsDigit).ToArray()), NumberStyles.Integer, CultureInfo.InvariantCulture);
await season.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);

Loading…
Cancel
Save