LiveTvVideoRecording.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Model.Configuration;
  3. using MediaBrowser.Model.Entities;
  4. using System.Linq;
  5. namespace MediaBrowser.Controller.LiveTv
  6. {
  7. public class LiveTvVideoRecording : Video, ILiveTvRecording
  8. {
  9. /// <summary>
  10. /// Gets the user data key.
  11. /// </summary>
  12. /// <returns>System.String.</returns>
  13. public override string GetUserDataKey()
  14. {
  15. var name = GetClientTypeName();
  16. if (!string.IsNullOrEmpty(RecordingInfo.ProgramId))
  17. {
  18. return name + "-" + RecordingInfo.ProgramId;
  19. }
  20. return name + "-" + RecordingInfo.Name + (RecordingInfo.EpisodeTitle ?? string.Empty);
  21. }
  22. public RecordingInfo RecordingInfo { get; set; }
  23. public string ServiceName { get; set; }
  24. public override string MediaType
  25. {
  26. get
  27. {
  28. return Model.Entities.MediaType.Video;
  29. }
  30. }
  31. public override LocationType LocationType
  32. {
  33. get
  34. {
  35. if (!string.IsNullOrEmpty(Path))
  36. {
  37. return base.LocationType;
  38. }
  39. return LocationType.Remote;
  40. }
  41. }
  42. /// <summary>
  43. /// Gets a value indicating whether this instance is owned item.
  44. /// </summary>
  45. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  46. public override bool IsOwnedItem
  47. {
  48. get
  49. {
  50. return false;
  51. }
  52. }
  53. public override string GetClientTypeName()
  54. {
  55. return "Recording";
  56. }
  57. public override bool IsSaveLocalMetadataEnabled()
  58. {
  59. return false;
  60. }
  61. public override bool SupportsLocalMetadata
  62. {
  63. get
  64. {
  65. return false;
  66. }
  67. }
  68. protected override bool GetBlockUnratedValue(UserConfiguration config)
  69. {
  70. return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
  71. }
  72. }
  73. }