aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/TV
diff options
context:
space:
mode:
authorShadowghost <Shadowghost@users.noreply.github.com>2023-05-21 13:52:43 +0200
committerGitHub <noreply@github.com>2023-05-21 13:52:43 +0200
commita496da24e3bebe66e5ed6d61a7cd1d51311d4c48 (patch)
tree8bebfd45c1c40b2b3956e29c4de19f9867cabcaf /MediaBrowser.Providers/TV
parent6ddc449a89ac615deb8c6d736e9cac7af4e02b9c (diff)
Apply suggestions from code review
Co-authored-by: Bond-009 <bond.009@outlook.com>
Diffstat (limited to 'MediaBrowser.Providers/TV')
-rw-r--r--MediaBrowser.Providers/TV/SeriesMetadataService.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/MediaBrowser.Providers/TV/SeriesMetadataService.cs b/MediaBrowser.Providers/TV/SeriesMetadataService.cs
index b99f1cbdb..85e248114 100644
--- a/MediaBrowser.Providers/TV/SeriesMetadataService.cs
+++ b/MediaBrowser.Providers/TV/SeriesMetadataService.cs
@@ -79,10 +79,7 @@ namespace MediaBrowser.Providers.TV
foreach (var season in sourceSeasonNames)
{
var seasonNumber = season.Key;
- if (!targetSeasonNames.ContainsKey(seasonNumber))
- {
- targetItem.SeasonNames[seasonNumber] = season.Value;
- }
+ targetSeasonNames.TryAdd(seasonNumber, season.Value);
}
}
@@ -219,9 +216,9 @@ namespace MediaBrowser.Providers.TV
var existingSeason = seasons.FirstOrDefault(i => i.IndexNumber == seasonNumber);
string? seasonName = null;
- if (seasonNumber.HasValue && seasonNames.ContainsKey(seasonNumber.Value))
+ if (seasonNumber.HasValue && seasonNames.TryGetValue(seasonNumber.Value, out var tmp))
{
- seasonName = seasonNames[seasonNumber.Value];
+ seasonName = tmp;
}
if (existingSeason is null)