From 1d849e3f2549b46014e9f8b422399f00fc55add1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 Feb 2017 02:47:12 -0500 Subject: update xmltv parsing --- Emby.Server.Implementations/Emby.Server.Implementations.csproj | 4 ++-- Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs | 3 ++- Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs | 2 +- .../LiveTv/Listings/XmlTvListingsProvider.cs | 8 ++++++-- Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs | 1 + Emby.Server.Implementations/packages.config | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 26053719bf..195d24b218 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -309,8 +309,8 @@ {4f26d5d8-a7b0-42b3-ba42-7cb7d245934e} SocketHttpListener.Portable - - ..\packages\Emby.XmlTv.1.0.4\lib\portable-net45+win8\Emby.XmlTv.dll + + ..\packages\Emby.XmlTv.1.0.5\lib\portable-net45+win8\Emby.XmlTv.dll True diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 07fe813bdb..f942597540 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -847,6 +847,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var channelMappings = GetChannelMappings(provider.Item2); var channelNumber = channel.Number; + var tunerChannelId = channel.TunerChannelId; if (!string.IsNullOrWhiteSpace(channelNumber)) { @@ -858,7 +859,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } } - var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken) + var programs = await provider.Item1.GetProgramsAsync(provider.Item2, tunerChannelId, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken) .ConfigureAwait(false); var list = programs.ToList(); diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index 66ad6911a0..e5790b875a 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -60,7 +60,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return dates; } - public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) + public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelId, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) { List programsInfo = new List(); diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index abb853eb23..adb4f359eb 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return cacheFile; } - public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) + public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelId, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) { if (!await EmbyTV.EmbyTVRegistration.Instance.EnableXmlTv().ConfigureAwait(false)) { @@ -161,8 +161,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings } else { - var uniqueString = (p.Title ?? string.Empty) + (episodeTitle ?? string.Empty); + var uniqueString = (p.Title ?? string.Empty) + (episodeTitle ?? string.Empty) + (p.IceTvEpisodeNumber ?? string.Empty); + if (programInfo.SeasonNumber.HasValue) + { + uniqueString = "-" + programInfo.SeasonNumber.Value.ToString(CultureInfo.InvariantCulture); + } if (programInfo.EpisodeNumber.HasValue) { uniqueString = "-" + programInfo.EpisodeNumber.Value.ToString(CultureInfo.InvariantCulture); diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs index 5e191ada9f..bac9664c5f 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs @@ -137,6 +137,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts if (attributes.TryGetValue("tvg-id", out value)) { channel.Id = value; + channel.TunerChannelId = value; } return channel; diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index a27d6b4e23..5249577e61 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -1,6 +1,6 @@  - + -- cgit v1.2.3