jellyfin-server/MediaBrowser.Controller/Entities/IHasTrailers.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2013-12-02 16:46:25 +00:00
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
2016-04-09 04:16:53 +00:00
using System.Linq;
2013-12-02 16:46:25 +00:00
namespace MediaBrowser.Controller.Entities
{
2014-12-11 06:20:28 +00:00
public interface IHasTrailers : IHasProviderIds
2013-12-02 16:46:25 +00: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-11 06:20:28 +00:00
List<Guid> RemoteTrailerIds { get; set; }
2016-04-09 04:16:53 +00:00
}
2014-12-11 06:20:28 +00:00
2016-04-09 04:16:53 +00:00
public static class HasTrailerExtensions
{
2014-12-11 06:20:28 +00:00
/// <summary>
/// Gets the trailer ids.
/// </summary>
/// <returns>List&lt;Guid&gt;.</returns>
2016-04-09 04:16:53 +00:00
public static List<Guid> GetTrailerIds(this IHasTrailers item)
{
var list = item.LocalTrailerIds.ToList();
list.AddRange(item.RemoteTrailerIds);
return list;
}
2013-12-02 16:46:25 +00:00
}
}