diff options
| author | Sven Van den brande <sven.vandenbrande@outlook.com> | 2013-11-02 22:38:21 +0100 |
|---|---|---|
| committer | Sven Van den brande <sven.vandenbrande@outlook.com> | 2013-11-02 22:38:21 +0100 |
| commit | 8f7021eb424a89ba0ee5c1acc52d03d149583a1a (patch) | |
| tree | 0e52261371d6e1c37a0fbb4909d64784f3ae9fdd /MediaBrowser.Api | |
| parent | e8f8d6651c86b3fd3350a5afae1d759fbbad06bd (diff) | |
Added EpgFullInfo & EpgInfo
Modified RecordingInfo & ChannelInfo
Changed LiveTvService
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/LiveTv/LiveTvService.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index f8e7b63709..6a8457ecb2 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -27,6 +27,13 @@ namespace MediaBrowser.Api.LiveTv { // Add filter by service if needed, and/or other filters } + + [Route("/LiveTv/EPG", "GET")] + [Api(Description = "Gets available live tv epgs..")] + public class GetEpg : IReturn<List<EpgFullInfo>> + { + // Add filter by service if needed, and/or other filters + } public class LiveTvService : BaseApiService { @@ -92,5 +99,23 @@ namespace MediaBrowser.Api.LiveTv return recordings.SelectMany(i => i); } + + public object Get(GetEpg request) + { + var result = GetEpgAsync(request).Result; + + return ToOptimizedResult(result); + } + + private async Task<IEnumerable<EpgFullInfo>> GetEpgAsync(GetEpg request) + { + var services = _liveTvManager.Services; + + var tasks = services.Select(i => i.GetEpgAsync(CancellationToken.None)); + + var epg = await Task.WhenAll(tasks).ConfigureAwait(false); + + return epg.SelectMany(i => i); + } } -} +}
\ No newline at end of file |
