2
0

ChannelVideoItem.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Model.Configuration;
  3. using MediaBrowser.Model.Entities;
  4. using System.Globalization;
  5. using System.Linq;
  6. namespace MediaBrowser.Controller.Channels
  7. {
  8. public class ChannelVideoItem : Video, IChannelMediaItem
  9. {
  10. public string ExternalId { get; set; }
  11. public ChannelItemType ChannelItemType { get; set; }
  12. public bool IsInfiniteStream { get; set; }
  13. public ChannelMediaContentType ContentType { get; set; }
  14. public string OriginalImageUrl { get; set; }
  15. public override string GetUserDataKey()
  16. {
  17. if (ContentType == ChannelMediaContentType.Trailer)
  18. {
  19. var key = this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? this.GetProviderId(MetadataProviders.Tvcom);
  20. if (!string.IsNullOrWhiteSpace(key))
  21. {
  22. key = key + "-trailer";
  23. // Make sure different trailers have their own data.
  24. if (RunTimeTicks.HasValue)
  25. {
  26. key += "-" + RunTimeTicks.Value.ToString(CultureInfo.InvariantCulture);
  27. }
  28. return key;
  29. }
  30. }
  31. return base.GetUserDataKey();
  32. }
  33. protected override bool GetBlockUnratedValue(UserConfiguration config)
  34. {
  35. return config.BlockUnratedItems.Contains(UnratedItem.ChannelContent);
  36. }
  37. public override bool SupportsLocalMetadata
  38. {
  39. get
  40. {
  41. return false;
  42. }
  43. }
  44. }
  45. }