jellyfin/MediaBrowser.Controller/Entities/IHasTrailers.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2013-12-02 09:46:25 -07:00
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
2016-04-08 21:16:53 -07:00
using System.Linq;
2013-12-02 09:46:25 -07:00
namespace MediaBrowser.Controller.Entities
{
2014-12-10 23:20:28 -07:00
public interface IHasTrailers : IHasProviderIds
2013-12-02 09:46:25 -07:00
{
/// <summary>
/// Gets or sets the remote trailers.
/// </summary>
/// <value>The remote trailers.</value>
List<MediaUrl> RemoteTrailers { get; set; }
/// <summary>
/// Gets or sets the local trailer ids.
/// </summary>
/// <value>The local trailer ids.</value>
List<Guid> LocalTrailerIds { get; set; }
2014-12-10 23:20:28 -07:00
List<Guid> RemoteTrailerIds { get; set; }
2016-04-08 21:16:53 -07:00
}
2014-12-10 23:20:28 -07:00
2016-04-08 21:16:53 -07:00
public static class HasTrailerExtensions
{
2014-12-10 23:20:28 -07:00
/// <summary>
/// Gets the trailer ids.
/// </summary>
/// <returns>List&lt;Guid&gt;.</returns>
2016-04-08 21:16:53 -07:00
public static List<Guid> GetTrailerIds(this IHasTrailers item)
{
var list = item.LocalTrailerIds.ToList();
list.AddRange(item.RemoteTrailerIds);
return list;
}
2013-12-02 09:46:25 -07:00
}
}