The Free Software Media System - Server Backend & API
stub out xml tv class
Luke Pulverenti6a6145294ad1
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.csindex 72a965c6ab..65d24ee806 100644--- a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs@@ -536,6 +536,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listingsthrow new ArgumentException("Authentication required.");}+ if (string.IsNullOrWhiteSpace(info.ListingsId))+ {+ throw new ArgumentException("Listings Id required");+ }+_logger.Info("Adding new LineUp ");var httpOptions = new HttpRequestOptions()@@ -564,6 +569,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listingsprivate async Task<bool> HasLineup(ListingsProviderInfo info, CancellationToken cancellationToken){+ if (string.IsNullOrWhiteSpace(info.ListingsId))+ {+ throw new ArgumentException("Listings Id required");+ }+var token = await GetToken(info, cancellationToken);_logger.Info("Headends on account ");@@ -577,9 +587,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listingsoptions.RequestHeaders["token"] = token;- using (Stream responce = await _httpClient.Get(options).ConfigureAwait(false))+ using (var response = await _httpClient.Get(options).ConfigureAwait(false)){- var root = _jsonSerializer.DeserializeFromStream<ScheduleDirect.Lineups>(responce);+ var root = _jsonSerializer.DeserializeFromStream<ScheduleDirect.Lineups>(response);return root.lineups.Any(i => string.Equals(info.ListingsId, i.lineup, StringComparison.OrdinalIgnoreCase));}@@ -587,6 +597,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listingspublic async Task Validate(ListingsProviderInfo info){+ if (string.IsNullOrWhiteSpace(info.ListingsId))+ {+ throw new ArgumentException("Listings Id required");+ }+var hasLineup = await HasLineup(info, CancellationToken.None).ConfigureAwait(false);if (!hasLineup)diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTv.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTv.csnew file mode 100644index 0000000000..2e6fc8277d--- /dev/null+++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTv.cs@@ -0,0 +1,44 @@+using MediaBrowser.Controller.LiveTv;+using MediaBrowser.Model.Dto;+using MediaBrowser.Model.LiveTv;+using System;+using System.Collections.Generic;+using System.Threading;+using System.Threading.Tasks;++namespace MediaBrowser.Server.Implementations.LiveTv.Listings+{+ public class XmlTv : IListingsProvider+ {+ public string Name+ {+ get { return "XmlTV"; }+ }++ public string Type+ {+ get { return "xmltv"; }+ }++ public Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)+ {+ throw new NotImplementedException();+ }++ public async Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken)+ {+ // Might not be needed+ }++ public Task Validate(ListingsProviderInfo info)+ {+ // Check that the path or url is valid. If not, throw a file not found exception+ }++ public Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location)+ {+ // In theory this should never be called because there is always only one lineup+ throw new NotImplementedException();+ }+ }+}diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.csindex eb8f8f80ee..1e30a4fd8d 100644--- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs@@ -272,7 +272,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerunvar url = GetApiUrl(info, true) + "/auto/v" + channelId;- if (!string.IsNullOrWhiteSpace(profile))+ if (!string.IsNullOrWhiteSpace(profile) && !string.Equals(profile, "native", StringComparison.OrdinalIgnoreCase)){url += "?transcode=" + profile;}@@ -316,7 +316,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun{var list = new List<MediaSourceInfo>();- list.Add(GetMediaSource(info, channelId, null));+ list.Add(GetMediaSource(info, channelId, "native"));try{@@ -343,7 +343,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerunpublic async Task<MediaSourceInfo> GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken){- return GetMediaSource(info, channelId, null);+ return GetMediaSource(info, channelId, streamId);}public async Task Validate(TunerHostInfo info)diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.jsonindex 674ee855f9..55236c2c6e 100644--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json@@ -824,5 +824,6 @@"ErrorAddingTunerDevice": "There was an error adding the tuner device. Please ensure it is accessible and try again.","ErrorSavingTvProvider": "There was an error saving the TV provider. Please ensure it is accessible and try again.","ErrorGettingTvLineups": "There was an error downloading tv lineups. Please ensure your username and password are correct and try again.",- "MessageCreateAccountAt": "Create an account at {0}"+ "MessageCreateAccountAt": "Create an account at {0}",+ "ErrorPleaseSelectLineup": "Please select a lineup and try again. If no lineups are available, then please check that your username, password, and postal code is correct."}diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.jsonindex 194d406f3c..2c2fd76a73 100644--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json@@ -1488,6 +1488,6 @@"LabelZipCode": "Zip Code:","GuideProviderListingsStep": "Step 2: Select Listings","GuideProviderLoginStep": "Step 1: Login",- "LabelLineup": "Lineup",+ "LabelLineup": "Lineup:","MessageTunerDeviceNotListed": "Is your tuner device not listed? Try installing an external service provider for more Live TV options."}diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csprojindex c77c112a63..0d8b748737 100644--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj@@ -222,6 +222,7 @@<Compile Include="LiveTv\EmbyTV\SeriesTimerManager.cs" /><Compile Include="LiveTv\EmbyTV\TimerManager.cs" /><Compile Include="LiveTv\Listings\SchedulesDirect.cs" />+ <Compile Include="LiveTv\Listings\XmlTv.cs" /><Compile Include="LiveTv\LiveTvConfigurationFactory.cs" /><Compile Include="LiveTv\LiveTvDtoService.cs" /><Compile Include="LiveTv\LiveTvManager.cs" />