LiveTvAudioRecording.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using MediaBrowser.Controller.Entities.Audio;
  2. using MediaBrowser.Model.Configuration;
  3. using MediaBrowser.Model.Entities;
  4. using System.Linq;
  5. namespace MediaBrowser.Controller.LiveTv
  6. {
  7. public class LiveTvAudioRecording : Audio, 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. /// <summary>
  25. /// Gets a value indicating whether this instance is owned item.
  26. /// </summary>
  27. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  28. public override bool IsOwnedItem
  29. {
  30. get
  31. {
  32. return false;
  33. }
  34. }
  35. public override string MediaType
  36. {
  37. get
  38. {
  39. return Model.Entities.MediaType.Audio;
  40. }
  41. }
  42. public override LocationType LocationType
  43. {
  44. get
  45. {
  46. if (!string.IsNullOrEmpty(Path))
  47. {
  48. return base.LocationType;
  49. }
  50. return LocationType.Remote;
  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. }