IHasTrailers.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using MediaBrowser.Model.Entities;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  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. List<MediaUrl> RemoteTrailers { get; set; }
  14. /// <summary>
  15. /// Gets or sets the local trailer ids.
  16. /// </summary>
  17. /// <value>The local trailer ids.</value>
  18. List<Guid> LocalTrailerIds { get; set; }
  19. List<Guid> RemoteTrailerIds { get; set; }
  20. }
  21. public static class HasTrailerExtensions
  22. {
  23. /// <summary>
  24. /// Gets the trailer ids.
  25. /// </summary>
  26. /// <returns>List&lt;Guid&gt;.</returns>
  27. public static List<Guid> GetTrailerIds(this IHasTrailers item)
  28. {
  29. var list = item.LocalTrailerIds.ToList();
  30. list.AddRange(item.RemoteTrailerIds);
  31. return list;
  32. }
  33. }
  34. }