aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs22
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs7
2 files changed, 26 insertions, 3 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index ae9c79c0e..84bd291a4 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -68,7 +68,7 @@ namespace MediaBrowser.Api.LiveTv
[Route("/LiveTv/Recordings/Groups", "GET")]
[Api(Description = "Gets live tv recording groups")]
- public class GetRecordingGroups : IReturn<QueryResult<RecordingInfoDto>>
+ public class GetRecordingGroups : IReturn<QueryResult<RecordingGroupDto>>
{
[ApiMember(Name = "UserId", Description = "Optional filter by user and attach user data.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string UserId { get; set; }
@@ -208,6 +208,14 @@ namespace MediaBrowser.Api.LiveTv
public string Id { get; set; }
}
+ [Route("/LiveTv/Recordings/Groups/{Id}", "GET")]
+ [Api(Description = "Gets a recording group")]
+ public class GetRecordingGroup : IReturn<RecordingGroupDto>
+ {
+ [ApiMember(Name = "Id", Description = "Recording group Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
public class LiveTvService : BaseApiService
{
private readonly ILiveTvManager _liveTvManager;
@@ -427,5 +435,17 @@ namespace MediaBrowser.Api.LiveTv
return ToOptimizedResult(result);
}
+
+ public object Get(GetRecordingGroup request)
+ {
+ var result = _liveTvManager.GetRecordingGroups(new RecordingGroupQuery
+ {
+
+ }, CancellationToken.None).Result;
+
+ var group = result.Items.FirstOrDefault(i => string.Equals(i.Id, request.Id, StringComparison.OrdinalIgnoreCase));
+
+ return ToOptimizedResult(group);
+ }
}
} \ No newline at end of file
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 999260b8d..5009addee 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -677,9 +677,12 @@ namespace MediaBrowser.Api.Playback
/// <returns>Task.</returns>
protected async Task StartFfMpeg(StreamState state, string outputPath)
{
- var parentPath = Path.GetDirectoryName(outputPath);
+ if (!File.Exists(MediaEncoder.EncoderPath))
+ {
+ throw new InvalidOperationException("ffmpeg was not found at " + MediaEncoder.EncoderPath);
+ }
- Directory.CreateDirectory(parentPath);
+ Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
if (state.IsInputVideo && state.VideoType == VideoType.Iso && state.IsoType.HasValue && IsoManager.CanMount(state.MediaPath))
{