IHasTrailers.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MediaBrowser.Model.Entities;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. public interface IHasTrailers : IHasProviderIds
  8. {
  9. /// <summary>
  10. /// Gets or sets the remote trailers.
  11. /// </summary>
  12. /// <value>The remote trailers.</value>
  13. MediaUrl[] RemoteTrailers { get; set; }
  14. /// <summary>
  15. /// Gets or sets the local trailer ids.
  16. /// </summary>
  17. /// <value>The local trailer ids.</value>
  18. Guid[] LocalTrailerIds { get; set; }
  19. Guid[] RemoteTrailerIds { get; set; }
  20. Guid Id { get; set; }
  21. }
  22. public static class HasTrailerExtensions
  23. {
  24. /// <summary>
  25. /// Gets the trailer ids.
  26. /// </summary>
  27. /// <returns>List&lt;Guid&gt;.</returns>
  28. public static List<Guid> GetTrailerIds(this IHasTrailers item)
  29. {
  30. var list = item.LocalTrailerIds.ToList();
  31. list.AddRange(item.RemoteTrailerIds);
  32. return list;
  33. }
  34. }
  35. }