2021-05-06 22:39:20 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Collections.Generic;
|
2019-01-13 19:25:32 +00:00
|
|
|
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>
|
2019-09-02 06:19:29 +00:00
|
|
|
IReadOnlyList<MediaUrl> RemoteTrailers { get; set; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2021-12-07 14:18:17 +00:00
|
|
|
/// Gets the local trailers.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2021-12-07 14:18:17 +00:00
|
|
|
/// <value>The local trailers.</value>
|
|
|
|
IReadOnlyList<BaseItem> LocalTrailers { get; }
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
|
2019-09-02 06:19:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Class providing extension methods for working with <see cref="IHasTrailers" />.
|
|
|
|
/// </summary>
|
2018-12-27 23:27:57 +00:00
|
|
|
public static class HasTrailerExtensions
|
|
|
|
{
|
2019-09-02 06:19:29 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the trailer count.
|
|
|
|
/// </summary>
|
2021-08-14 03:34:36 +00:00
|
|
|
/// <param name="item">Media item.</param>
|
2019-09-02 06:19:29 +00:00
|
|
|
/// <returns><see cref="IReadOnlyList{Guid}" />.</returns>
|
|
|
|
public static int GetTrailerCount(this IHasTrailers item)
|
2021-12-07 14:18:17 +00:00
|
|
|
=> item.LocalTrailers.Count + item.RemoteTrailers.Count;
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|