Apply review suggestion

This commit is contained in:
Shadowghost 2024-06-11 18:48:38 +02:00
parent e4078f984a
commit 1a14902da8
4 changed files with 4 additions and 29 deletions

View File

@ -194,7 +194,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <param name="item">The item.</param>
/// <exception cref="InvalidOperationException">Unable to add + item.Name.</exception>
public virtual void AddChild(BaseItem item)
public void AddChild(BaseItem item)
{
item.SetParent(this);

View File

@ -265,20 +265,5 @@ namespace MediaBrowser.Controller.Entities.TV
return hasChanges;
}
/// <inheritdoc />
public override void AddChild(BaseItem item)
{
if (item is Episode episode)
{
episode.SeriesPresentationUniqueKey = SeriesPresentationUniqueKey;
episode.SeriesId = SeriesId;
episode.SeriesName = SeriesName;
episode.SeasonId = Id;
episode.SeasonName = Name;
}
base.AddChild(item);
}
}
}

View File

@ -499,18 +499,5 @@ namespace MediaBrowser.Controller.Entities.TV
return list;
}
/// <inheritdoc />
public override void AddChild(BaseItem item)
{
if (item is IHasSeries typedItem)
{
typedItem.SeriesId = Id;
typedItem.SeriesName = Name;
typedItem.SeriesPresentationUniqueKey = PresentationUniqueKey;
}
base.AddChild(item);
}
}
}

View File

@ -241,6 +241,9 @@ namespace MediaBrowser.Providers.TV
series.Id + (seasonNumber ?? -1).ToString(CultureInfo.InvariantCulture) + seasonName,
typeof(Season)),
IsVirtualItem = false,
SeriesId = series.Id,
SeriesName = series.Name,
SeriesPresentationUniqueKey = series.GetPresentationUniqueKey()
};
series.AddChild(season);