The Free Software Media System - Server Backend & API
update handling of new programs for xml tv
Luke Pulverenti296e5bfe32bd
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex 42e8c4f5fa..d18004f963 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs@@ -2543,13 +2543,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVpublic CancellationTokenSource CancellationTokenSource { get; set; }}+ private const int TunerDiscoveryDurationMs = 3000;+public async Task<List<TunerHostInfo>> DiscoverTuners(CancellationToken cancellationToken){var list = new List<TunerHostInfo>();foreach (var host in _liveTvManager.TunerHosts){- var discoveredDevices = await DiscoverDevices(host, 3000, cancellationToken).ConfigureAwait(false);+ var discoveredDevices = await DiscoverDevices(host, TunerDiscoveryDurationMs, cancellationToken).ConfigureAwait(false);list.AddRange(discoveredDevices);}@@ -2567,7 +2569,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVprivate async Task ScanForTunerDeviceChanges(ITunerHost host, CancellationToken cancellationToken){- var discoveredDevices = await DiscoverDevices(host, 3000, cancellationToken).ConfigureAwait(false);+ var discoveredDevices = await DiscoverDevices(host, TunerDiscoveryDurationMs, cancellationToken).ConfigureAwait(false);var configuredDevices = GetConfiguration().TunerHosts.Where(i => string.Equals(i.Type, host.Type, StringComparison.OrdinalIgnoreCase))diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.csindex c22bb11710..21c4006a6e 100644--- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs+++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs@@ -205,6 +205,15 @@ namespace Emby.Server.Implementations.LiveTv.Listings}programInfo.ShowId = uniqueString.GetMD5().ToString("N");++ // If we don't have valid episode info, assume it's a unique program, otherwise recordings might be skipped+ if (programInfo.IsSeries && !programInfo.IsRepeat)+ {+ if ((programInfo.EpisodeNumber ?? 0) == 0)+ {+ programInfo.ShowId = programInfo.ShowId + programInfo.StartDate.Ticks.ToString(CultureInfo.InvariantCulture);+ }+ }}// Construct an id from the channel and start date