Apply review suggestion
This commit is contained in:
parent
48228430c0
commit
1cdf0f5cc4
|
@ -214,15 +214,19 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
|
||||
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>()
|
||||
.Where(s => s.IndexNumber.HasValue)
|
||||
.DistinctBy(s => s.IndexNumber)
|
||||
.ToDictionary(s => s.IndexNumber.Value, s => s.Name);
|
||||
return _seasonNames;
|
||||
}
|
||||
|
||||
public void SetSeasonName(int index, string name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user