aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-10-05 11:20:48 -0400
committerGitHub <noreply@github.com>2016-10-05 11:20:48 -0400
commita2fa7c475404347aaf675bdd708a69c451f5af2e (patch)
treee9aa273f5d6d77473d3d1f345e2890c864a0e481 /MediaBrowser.Controller
parent0a87046736843dfa983213ae1e661d499a6d1df9 (diff)
parent83606d82d57604f9796455640d2e93367783f69e (diff)
Merge pull request #2210 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Chapters/ChapterResponse.cs19
-rw-r--r--MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs31
-rw-r--r--MediaBrowser.Controller/Chapters/IChapterManager.cs47
-rw-r--r--MediaBrowser.Controller/Chapters/IChapterProvider.cs39
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceManager.cs8
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceProvider.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs6
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj3
9 files changed, 19 insertions, 140 deletions
diff --git a/MediaBrowser.Controller/Chapters/ChapterResponse.cs b/MediaBrowser.Controller/Chapters/ChapterResponse.cs
deleted file mode 100644
index 3c1b8ed07..000000000
--- a/MediaBrowser.Controller/Chapters/ChapterResponse.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using MediaBrowser.Model.Chapters;
-using System.Collections.Generic;
-
-namespace MediaBrowser.Controller.Chapters
-{
- public class ChapterResponse
- {
- /// <summary>
- /// Gets or sets the chapters.
- /// </summary>
- /// <value>The chapters.</value>
- public List<RemoteChapterInfo> Chapters { get; set; }
-
- public ChapterResponse()
- {
- Chapters = new List<RemoteChapterInfo>();
- }
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs b/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs
deleted file mode 100644
index 982dc35bb..000000000
--- a/MediaBrowser.Controller/Chapters/ChapterSearchRequest.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Entities;
-using System;
-using System.Collections.Generic;
-
-namespace MediaBrowser.Controller.Chapters
-{
- public class ChapterSearchRequest : IHasProviderIds
- {
- public string Language { get; set; }
-
- public VideoContentType ContentType { get; set; }
-
- public string MediaPath { get; set; }
- public string SeriesName { get; set; }
- public string Name { get; set; }
- public int? IndexNumber { get; set; }
- public int? IndexNumberEnd { get; set; }
- public int? ParentIndexNumber { get; set; }
- public int? ProductionYear { get; set; }
- public long? RuntimeTicks { get; set; }
- public Dictionary<string, string> ProviderIds { get; set; }
-
- public bool SearchAllProviders { get; set; }
-
- public ChapterSearchRequest()
- {
- ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- }
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.Controller/Chapters/IChapterManager.cs b/MediaBrowser.Controller/Chapters/IChapterManager.cs
index 27e06fb8d..4b39e66cc 100644
--- a/MediaBrowser.Controller/Chapters/IChapterManager.cs
+++ b/MediaBrowser.Controller/Chapters/IChapterManager.cs
@@ -1,6 +1,4 @@
-using MediaBrowser.Controller.Entities;
-using MediaBrowser.Model.Chapters;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Configuration;
@@ -14,12 +12,6 @@ namespace MediaBrowser.Controller.Chapters
public interface IChapterManager
{
/// <summary>
- /// Adds the parts.
- /// </summary>
- /// <param name="chapterProviders">The chapter providers.</param>
- void AddParts(IEnumerable<IChapterProvider> chapterProviders);
-
- /// <summary>
/// Gets the chapters.
/// </summary>
/// <param name="itemId">The item identifier.</param>
@@ -36,43 +28,6 @@ namespace MediaBrowser.Controller.Chapters
Task SaveChapters(string itemId, List<ChapterInfo> chapters, CancellationToken cancellationToken);
/// <summary>
- /// Searches the specified video.
- /// </summary>
- /// <param name="video">The video.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{IEnumerable{RemoteChapterResult}}.</returns>
- Task<IEnumerable<RemoteChapterResult>> Search(Video video, CancellationToken cancellationToken);
-
- /// <summary>
- /// Searches the specified request.
- /// </summary>
- /// <param name="request">The request.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{IEnumerable{RemoteChapterResult}}.</returns>
- Task<IEnumerable<RemoteChapterResult>> Search(ChapterSearchRequest request, CancellationToken cancellationToken);
-
- /// <summary>
- /// Gets the chapters.
- /// </summary>
- /// <param name="id">The identifier.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{ChapterResponse}.</returns>
- Task<ChapterResponse> GetChapters(string id, CancellationToken cancellationToken);
-
- /// <summary>
- /// Gets the providers.
- /// </summary>
- /// <param name="itemId">The item identifier.</param>
- /// <returns>IEnumerable{ChapterProviderInfo}.</returns>
- IEnumerable<ChapterProviderInfo> GetProviders(string itemId);
-
- /// <summary>
- /// Gets the providers.
- /// </summary>
- /// <returns>IEnumerable{ChapterProviderInfo}.</returns>
- IEnumerable<ChapterProviderInfo> GetProviders();
-
- /// <summary>
/// Gets the configuration.
/// </summary>
/// <returns>ChapterOptions.</returns>
diff --git a/MediaBrowser.Controller/Chapters/IChapterProvider.cs b/MediaBrowser.Controller/Chapters/IChapterProvider.cs
deleted file mode 100644
index a7505347b..000000000
--- a/MediaBrowser.Controller/Chapters/IChapterProvider.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Chapters;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Controller.Chapters
-{
- public interface IChapterProvider
- {
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- string Name { get; }
-
- /// <summary>
- /// Gets the supported media types.
- /// </summary>
- /// <value>The supported media types.</value>
- IEnumerable<VideoContentType> SupportedMediaTypes { get; }
-
- /// <summary>
- /// Searches the specified request.
- /// </summary>
- /// <param name="request">The request.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{IEnumerable{RemoteChapterResult}}.</returns>
- Task<IEnumerable<RemoteChapterResult>> Search(ChapterSearchRequest request, CancellationToken cancellationToken);
-
- /// <summary>
- /// Gets the chapters.
- /// </summary>
- /// <param name="id">The identifier.</param>
- /// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task{ChapterResponse}.</returns>
- Task<ChapterResponse> GetChapters(string id, CancellationToken cancellationToken);
- }
-}
diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
index c06470c5e..1ab0e4cb0 100644
--- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using System.IO;
namespace MediaBrowser.Controller.Library
{
@@ -79,6 +80,8 @@ namespace MediaBrowser.Controller.Library
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
Task<MediaSourceInfo> GetLiveStream(string id, CancellationToken cancellationToken);
+
+ Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> GetLiveStreamWithDirectStreamProvider(string id, CancellationToken cancellationToken);
/// <summary>
/// Pings the media source.
@@ -95,4 +98,9 @@ namespace MediaBrowser.Controller.Library
/// <returns>Task.</returns>
Task CloseLiveStream(string id);
}
+
+ public interface IDirectStreamProvider
+ {
+ Task CopyToAsync(Stream stream, CancellationToken cancellationToken);
+ }
}
diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
index 56366e5a8..b0881ba7c 100644
--- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
+++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs
@@ -3,6 +3,7 @@ using MediaBrowser.Model.Dto;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using System;
namespace MediaBrowser.Controller.Library
{
@@ -22,7 +23,7 @@ namespace MediaBrowser.Controller.Library
/// <param name="openToken">The open token.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
- Task<MediaSourceInfo> OpenMediaSource(string openToken, CancellationToken cancellationToken);
+ Task<Tuple<MediaSourceInfo,IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken);
/// <summary>
/// Closes the media source.
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index d65d1ae30..a381c7980 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Events;
+using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -156,7 +157,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="mediaSourceId">The media source identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{StreamResponseInfo}.</returns>
- Task<MediaSourceInfo> GetChannelStream(string id, string mediaSourceId, CancellationToken cancellationToken);
+ Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> GetChannelStream(string id, string mediaSourceId, CancellationToken cancellationToken);
/// <summary>
/// Gets the program.
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index d7d8336d0..94082b42e 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -245,4 +246,9 @@ namespace MediaBrowser.Controller.LiveTv
/// <returns>Task.</returns>
Task<string> CreateSeriesTimer(SeriesTimerInfo info, CancellationToken cancellationToken);
}
+
+ public interface ISupportsDirectStreamProvider
+ {
+ Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, CancellationToken cancellationToken);
+ }
}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index d70fba742..e9d2054da 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -91,10 +91,7 @@
<Compile Include="Channels\InternalChannelItemQuery.cs" />
<Compile Include="Channels\IRequiresMediaInfoCallback.cs" />
<Compile Include="Channels\ISearchableChannel.cs" />
- <Compile Include="Chapters\ChapterSearchRequest.cs" />
<Compile Include="Chapters\IChapterManager.cs" />
- <Compile Include="Chapters\IChapterProvider.cs" />
- <Compile Include="Chapters\ChapterResponse.cs" />
<Compile Include="Collections\CollectionCreationOptions.cs" />
<Compile Include="Collections\CollectionEvents.cs" />
<Compile Include="Collections\ICollectionManager.cs" />