mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
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()
|
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…
x
Reference in New Issue
Block a user