aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs19
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTv.cs44
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json3
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json2
-rw-r--r--MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj1
6 files changed, 68 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs
index 72a965c6a..65d24ee80 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.Listings
throw 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.Listings
private 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.Listings
options.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.Listings
public 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.cs
new file mode 100644
index 000000000..2e6fc8277
--- /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.cs
index eb8f8f80e..1e30a4fd8 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.HdHomerun
var 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.HdHomerun
public 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.json
index 674ee855f..55236c2c6 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.json
index 194d406f3..2c2fd76a7 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.csproj
index c77c112a6..0d8b74873 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" />