Don't cache special feature ids

This commit is contained in:
cvium 2021-12-21 00:10:58 +01:00
parent 9158511017
commit 05c8834a3a
2 changed files with 6 additions and 19 deletions

View File

@ -10,9 +10,9 @@ namespace MediaBrowser.Controller.Entities
public interface IHasSpecialFeatures
{
/// <summary>
/// Gets or sets the special feature ids.
/// Gets the special feature ids.
/// </summary>
/// <value>The special feature ids.</value>
IReadOnlyList<Guid> SpecialFeatureIds { get; set; }
IReadOnlyList<Guid> SpecialFeatureIds { get; }
}
}

View File

@ -19,24 +19,11 @@ namespace MediaBrowser.Controller.Entities.Movies
/// </summary>
public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
{
private IReadOnlyList<Guid> _specialFeatureIds;
/// <inheritdoc />
public IReadOnlyList<Guid> SpecialFeatureIds
{
get
{
return _specialFeatureIds ??= GetExtras()
.Where(extra => extra.ExtraType != Model.Entities.ExtraType.Trailer)
.Select(song => song.Id)
.ToArray();
}
set
{
_specialFeatureIds = value;
}
}
public IReadOnlyList<Guid> SpecialFeatureIds => GetExtras()
.Where(extra => extra.ExtraType != null && extra is Video)
.Select(extra => extra.Id)
.ToArray();
/// <inheritdoc />
public IReadOnlyList<BaseItem> LocalTrailers => GetExtras()