diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-01 13:26:31 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-01 13:26:31 -0500 |
| commit | b9d17c9bc765a0c59d81db6277300a6860bf8421 (patch) | |
| tree | 8a7c538cb73c27b7e06f0055ce4f0bb45175e7aa /MediaBrowser.Controller/LiveTv | |
| parent | 88b638fbd69ed99bde7065f66af433b015977cb7 (diff) | |
add more methods to file system interface
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs | 52 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs (renamed from MediaBrowser.Controller/LiveTv/LiveTvRecording.cs) | 15 |
4 files changed, 91 insertions, 4 deletions
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 /// <param name="id">The identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>LiveTvRecording.</returns> - Task<LiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken); + Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken); /// <summary> /// 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<bool> 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 + { + /// <summary> + /// Gets the user data key. + /// </summary> + /// <returns>System.String.</returns> + 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/LiveTvVideoRecording.cs index 1c453ab5a1..9dfc7f828d 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -1,10 +1,9 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { - public class LiveTvRecording : BaseItem + public class LiveTvVideoRecording : Video, ILiveTvRecording { /// <summary> /// Gets the user data key. @@ -23,7 +22,7 @@ namespace MediaBrowser.Controller.LiveTv { get { - return RecordingInfo.ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; + return Model.Entities.MediaType.Video; } } @@ -31,6 +30,11 @@ namespace MediaBrowser.Controller.LiveTv { get { + if (!string.IsNullOrEmpty(Path)) + { + return base.LocationType; + } + return LocationType.Remote; } } @@ -39,5 +43,10 @@ namespace MediaBrowser.Controller.LiveTv { return "Recording"; } + + public override bool IsSaveLocalMetadataEnabled() + { + return false; + } } } |
