diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-22 13:58:51 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-22 13:58:51 -0500 |
| commit | 4c2623d540465088ce8f316eae21541ae807cd84 (patch) | |
| tree | 6c88291c7610a289896ec27465a608c2a20c232f /MediaBrowser.Controller | |
| parent | cac101cc21b5420160a53a64d0950344ee3cd637 (diff) | |
support streaming of tv recordings
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Library/TVUtils.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/StreamResponseInfo.cs (renamed from MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs) | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 2 |
7 files changed, 26 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 8b18754c03..d7504a86e4 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -124,6 +124,11 @@ namespace MediaBrowser.Controller.Library { var filename = Path.GetFileName(path); + if (string.Equals(path, "specials", StringComparison.OrdinalIgnoreCase)) + { + return 0; + } + // Look for one of the season folder names foreach (var name in SeasonFolderNames) { diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 40cc4bae5c..1d98dc7cf8 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Entities; +using System.IO; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Querying; using System.Collections.Generic; @@ -153,6 +154,14 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="cancellationToken">The cancellation token.</param> /// <returns>LiveTvRecording.</returns> Task<LiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken); + + /// <summary> + /// Gets the recording stream. + /// </summary> + /// <param name="id">The identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{Stream}.</returns> + Task<StreamResponseInfo> GetRecordingStream(string id, CancellationToken cancellationToken); /// <summary> /// Gets the program. diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 3a6cbf583c..31dbd8e998 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.IO; using System.Threading; using System.Threading.Tasks; @@ -85,7 +84,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="channelId">The channel identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{Stream}.</returns> - Task<ImageResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken); + Task<StreamResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken); /// <summary> /// Gets the recording image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to RecordingInfo @@ -93,7 +92,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="recordingId">The recording identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{ImageResponseInfo}.</returns> - Task<ImageResponseInfo> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken); + Task<StreamResponseInfo> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken); /// <summary> /// Gets the program image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ProgramInfo @@ -102,7 +101,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="channelId">The channel identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{ImageResponseInfo}.</returns> - Task<ImageResponseInfo> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken); + Task<StreamResponseInfo> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken); /// <summary> /// Gets the recordings asynchronous. @@ -146,7 +145,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="recordingId">The recording identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{Stream}.</returns> - Task<Stream> GetRecordingStream(string recordingId, CancellationToken cancellationToken); + Task<StreamResponseInfo> GetRecordingStream(string recordingId, CancellationToken cancellationToken); /// <summary> /// Gets the channel stream. @@ -154,6 +153,6 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="recordingId">The recording identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{Stream}.</returns> - Task<Stream> GetChannelStream(string recordingId, CancellationToken cancellationToken); + Task<StreamResponseInfo> GetChannelStream(string recordingId, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index babd9f54c5..abacc0c18e 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,4 +1,5 @@ using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { @@ -15,13 +16,15 @@ namespace MediaBrowser.Controller.LiveTv public ProgramInfo ProgramInfo { get; set; } + public ChannelType ChannelType { get; set; } + public string ServiceName { get; set; } public override string MediaType { get { - return ProgramInfo.IsVideo ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio; + return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio; } } diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 671c4b5914..72ecb3ec99 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -128,12 +128,6 @@ namespace MediaBrowser.Controller.LiveTv public bool IsSeries { get; set; } /// <summary> - /// Gets or sets a value indicating whether this instance is video. - /// </summary> - /// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value> - public bool IsVideo { get; set; } - - /// <summary> /// Gets or sets a value indicating whether this instance is live. /// </summary> /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value> diff --git a/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs b/MediaBrowser.Controller/LiveTv/StreamResponseInfo.cs index d454a1ef8d..c3b438c5ee 100644 --- a/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs +++ b/MediaBrowser.Controller/LiveTv/StreamResponseInfo.cs @@ -2,7 +2,7 @@ namespace MediaBrowser.Controller.LiveTv { - public class ImageResponseInfo + public class StreamResponseInfo { /// <summary> /// Gets or sets the stream. diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index a200f610b5..de9aa3b9f9 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -112,7 +112,7 @@ <Compile Include="LiveTv\ChannelInfo.cs" /> <Compile Include="LiveTv\ILiveTvManager.cs" /> <Compile Include="LiveTv\ILiveTvService.cs" /> - <Compile Include="LiveTv\ImageResponseInfo.cs" /> + <Compile Include="LiveTv\StreamResponseInfo.cs" /> <Compile Include="LiveTv\LiveTvProgram.cs" /> <Compile Include="LiveTv\LiveTvRecording.cs" /> <Compile Include="LiveTv\ProgramInfo.cs" /> |
