Apply review suggestion

pull/11647/head
Shadowghost 9 months ago
parent 48228430c0
commit 1cdf0f5cc4

@ -214,15 +214,19 @@ namespace MediaBrowser.Controller.Entities.TV
public Dictionary<int, string> GetSeasonNames() public Dictionary<int, string> GetSeasonNames()
{ {
if (_seasonNames.Count > 0) if (_seasonNames.Count == 0)
{ {
return _seasonNames; var childSeasons = Children.OfType<Season>()
.Where(s => s.IndexNumber.HasValue)
.DistinctBy(s => s.IndexNumber);
foreach (var season in childSeasons)
{
_seasonNames[season.IndexNumber.Value] = season.Name;
}
} }
return Children.OfType<Season>() return _seasonNames;
.Where(s => s.IndexNumber.HasValue)
.DistinctBy(s => s.IndexNumber)
.ToDictionary(s => s.IndexNumber.Value, s => s.Name);
} }
public void SetSeasonName(int index, string name) public void SetSeasonName(int index, string name)

Loading…
Cancel
Save