From b9d17c9bc765a0c59d81db6277300a6860bf8421 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 Jan 2014 13:26:31 -0500 Subject: add more methods to file system interface --- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 2 +- MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs | 26 +++++++++++ .../LiveTv/LiveTvAudioRecording.cs | 52 ++++++++++++++++++++++ MediaBrowser.Controller/LiveTv/LiveTvRecording.cs | 43 ------------------ .../LiveTv/LiveTvVideoRecording.cs | 52 ++++++++++++++++++++++ 5 files changed, 131 insertions(+), 44 deletions(-) create mode 100644 MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs create mode 100644 MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs delete mode 100644 MediaBrowser.Controller/LiveTv/LiveTvRecording.cs create mode 100644 MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs (limited to 'MediaBrowser.Controller/LiveTv') diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index c26e29d942..87ac0d4dc6 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -153,7 +153,7 @@ namespace MediaBrowser.Controller.LiveTv /// The identifier. /// The cancellation token. /// LiveTvRecording. - Task GetInternalRecording(string id, CancellationToken cancellationToken); + Task GetInternalRecording(string id, CancellationToken cancellationToken); /// /// Gets the recording stream. diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs new file mode 100644 index 0000000000..d9bceb6cad --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs @@ -0,0 +1,26 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Entities; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.LiveTv +{ + public interface ILiveTvRecording : IHasImages, IHasMediaStreams + { + string ServiceName { get; set; } + + string MediaType { get; } + + LocationType LocationType { get; } + + RecordingInfo RecordingInfo { get; set; } + + string GetClientTypeName(); + + string GetUserDataKey(); + + bool IsParentalAllowed(User user); + + Task RefreshMetadata(CancellationToken cancellationToken, bool forceSave = false, bool forceRefresh = false, bool allowSlowProviders = true, bool resetResolveArgs = true); + } +} diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs new file mode 100644 index 0000000000..8676540fd0 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -0,0 +1,52 @@ +using MediaBrowser.Controller.Entities.Audio; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Controller.LiveTv +{ + public class LiveTvAudioRecording : Audio, ILiveTvRecording + { + /// + /// Gets the user data key. + /// + /// System.String. + public override string GetUserDataKey() + { + return GetClientTypeName() + "-" + Name; + } + + public RecordingInfo RecordingInfo { get; set; } + + public string ServiceName { get; set; } + + public override string MediaType + { + get + { + return Model.Entities.MediaType.Audio; + } + } + + public override LocationType LocationType + { + get + { + if (!string.IsNullOrEmpty(Path)) + { + return base.LocationType; + } + + return LocationType.Remote; + } + } + + public override string GetClientTypeName() + { + return "Recording"; + } + + public override bool IsSaveLocalMetadataEnabled() + { + return false; + } + } +} diff --git a/MediaBrowser.Controller/LiveTv/LiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvRecording.cs deleted file mode 100644 index 1c453ab5a1..0000000000 --- a/MediaBrowser.Controller/LiveTv/LiveTvRecording.cs +++ /dev/null @@ -1,43 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.LiveTv; - -namespace MediaBrowser.Controller.LiveTv -{ - public class LiveTvRecording : BaseItem - { - /// - /// Gets the user data key. - /// - /// System.String. - public override string GetUserDataKey() - { - return GetClientTypeName() + "-" + Name; - } - - public RecordingInfo RecordingInfo { get; set; } - - public string ServiceName { get; set; } - - public override string MediaType - { - get - { - return RecordingInfo.ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; - } - } - - public override LocationType LocationType - { - get - { - return LocationType.Remote; - } - } - - public override string GetClientTypeName() - { - return "Recording"; - } - } -} diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs new file mode 100644 index 0000000000..9dfc7f828d --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -0,0 +1,52 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Controller.LiveTv +{ + public class LiveTvVideoRecording : Video, ILiveTvRecording + { + /// + /// Gets the user data key. + /// + /// System.String. + public override string GetUserDataKey() + { + return GetClientTypeName() + "-" + Name; + } + + public RecordingInfo RecordingInfo { get; set; } + + public string ServiceName { get; set; } + + public override string MediaType + { + get + { + return Model.Entities.MediaType.Video; + } + } + + public override LocationType LocationType + { + get + { + if (!string.IsNullOrEmpty(Path)) + { + return base.LocationType; + } + + return LocationType.Remote; + } + } + + public override string GetClientTypeName() + { + return "Recording"; + } + + public override bool IsSaveLocalMetadataEnabled() + { + return false; + } + } +} -- cgit v1.2.3