jellyfin/MediaBrowser.Controller/Entities/IHasTrailers.cs

40 lines
1.0 KiB
C#
Raw Normal View History

using System;
2018-12-27 23:27:57 +00:00
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Entities;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Controller.Entities
{
public interface IHasTrailers : IHasProviderIds
{
/// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
MediaUrl[] RemoteTrailers { get; set; }
/// <summary>
/// Gets or sets the local trailer ids.
/// </summary>
/// <value>The local trailer ids.</value>
Guid[] LocalTrailerIds { get; set; }
Guid[] RemoteTrailerIds { get; set; }
Guid Id { get; set; }
}
public static class HasTrailerExtensions
{
/// <summary>
/// Gets the trailer ids.
/// </summary>
/// <returns>List&lt;Guid&gt;.</returns>
public static List<Guid> GetTrailerIds(this IHasTrailers item)
{
var list = item.LocalTrailerIds.ToList();
list.AddRange(item.RemoteTrailerIds);
return list;
}
}
}