diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-07-29 13:16:00 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-07-29 13:16:00 -0400 |
| commit | 1f6b5a8c7c049bea309351dd495d99ec21eb32cb (patch) | |
| tree | 29238cb6854bbca3355fa1f3e40b30a461fddb34 /MediaBrowser.Api | |
| parent | 4d7f98361894e9de90ab964c3496fb7f613c28e2 (diff) | |
update live tv recordings
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/LiveTv/LiveTvService.cs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index b0359194c7..6814ad751b 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -1,4 +1,5 @@ using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; @@ -376,17 +377,40 @@ namespace MediaBrowser.Api.LiveTv public string Country { get; set; } } + [Route("/LiveTv/ListingProviders/SchedulesDirect/Countries", "GET", Summary = "Gets available lineups")] + [Authenticated] + public class GetSchedulesDirectCountries + { + } + public class LiveTvService : BaseApiService { private readonly ILiveTvManager _liveTvManager; private readonly IUserManager _userManager; private readonly IConfigurationManager _config; + private readonly IHttpClient _httpClient; - public LiveTvService(ILiveTvManager liveTvManager, IUserManager userManager, IConfigurationManager config) + public LiveTvService(ILiveTvManager liveTvManager, IUserManager userManager, IConfigurationManager config, IHttpClient httpClient) { _liveTvManager = liveTvManager; _userManager = userManager; _config = config; + _httpClient = httpClient; + } + + public async Task<object> Get(GetSchedulesDirectCountries request) + { + // https://json.schedulesdirect.org/20141201/available/countries + + var response = await _httpClient.Get(new HttpRequestOptions + { + Url = "https://json.schedulesdirect.org/20141201/available/countries", + CacheLength = TimeSpan.FromDays(1), + CacheMode = CacheMode.Unconditional + + }).ConfigureAwait(false); + + return ResultFactory.GetResult(response, "application/json"); } private void AssertUserCanManageLiveTv() |
