| | | 1 | | #nullable disable |
| | | 2 | | |
| | | 3 | | #pragma warning disable CS1591 |
| | | 4 | | |
| | | 5 | | using System.Collections.Generic; |
| | | 6 | | using MediaBrowser.Model.Entities; |
| | | 7 | | |
| | | 8 | | namespace MediaBrowser.Controller.Entities |
| | | 9 | | { |
| | | 10 | | public interface IHasTrailers : IHasProviderIds |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Gets or sets the remote trailers. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <value>The remote trailers.</value> |
| | | 16 | | IReadOnlyList<MediaUrl> RemoteTrailers { get; set; } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Gets the local trailers. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <value>The local trailers.</value> |
| | | 22 | | IReadOnlyList<BaseItem> LocalTrailers { get; } |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Class providing extension methods for working with <see cref="IHasTrailers" />. |
| | | 27 | | /// </summary> |
| | | 28 | | public static class HasTrailerExtensions |
| | | 29 | | { |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets the trailer count. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="item">Media item.</param> |
| | | 34 | | /// <returns><see cref="IReadOnlyList{Guid}" />.</returns> |
| | | 35 | | public static int GetTrailerCount(this IHasTrailers item) |
| | 0 | 36 | | => item.LocalTrailers.Count + item.RemoteTrailers.Count; |
| | | 37 | | } |
| | | 38 | | } |