aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/LiveTv/LiveTvService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/LiveTv/LiveTvService.cs')
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs36
1 files changed, 33 insertions, 3 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index 4cd75afca..0e40db58c 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -1,12 +1,12 @@
-using System.Threading;
-using System.Threading.Tasks;
-using MediaBrowser.Controller.LiveTv;
+using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Querying;
using ServiceStack.ServiceHost;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
namespace MediaBrowser.Api.LiveTv
{
@@ -58,6 +58,22 @@ namespace MediaBrowser.Api.LiveTv
public string ChannelId { get; set; }
}
+ [Route("/LiveTv/Recordings/{Id}", "GET")]
+ [Api(Description = "Gets a live tv recording")]
+ public class GetRecording : IReturn<RecordingInfoDto>
+ {
+ [ApiMember(Name = "Id", Description = "Recording Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
+ [Route("/LiveTv/Timers/{Id}", "GET")]
+ [Api(Description = "Gets a live tv timer")]
+ public class GetTimer : IReturn<TimerInfoDto>
+ {
+ [ApiMember(Name = "Id", Description = "Timer Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public string Id { get; set; }
+ }
+
[Route("/LiveTv/Timers", "GET")]
[Api(Description = "Gets live tv timers")]
public class GetTimers : IReturn<QueryResult<TimerInfoDto>>
@@ -182,6 +198,20 @@ namespace MediaBrowser.Api.LiveTv
return ToOptimizedResult(result);
}
+ public object Get(GetRecording request)
+ {
+ var result = _liveTvManager.GetRecording(request.Id, CancellationToken.None).Result;
+
+ return ToOptimizedResult(result);
+ }
+
+ public object Get(GetTimer request)
+ {
+ var result = _liveTvManager.GetTimer(request.Id, CancellationToken.None).Result;
+
+ return ToOptimizedResult(result);
+ }
+
public object Get(GetTimers request)
{
var result = _liveTvManager.GetTimers(new TimerQuery