From fa7a331bd7decf54e1929dcdf148fd85a48c9ed0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 16 Mar 2016 16:38:01 -0400 Subject: [PATCH 1/3] add object assign polyfill --- MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 4d167c4375..8a66398f2a 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -269,6 +269,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest From 30bc82a8d389ea184794277018318ae433eae530 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 16 Mar 2016 17:30:49 -0400 Subject: [PATCH 2/3] update script dependencies --- MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 463e91fd4c..c88f88c6e4 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -219,7 +219,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV { try { - await provider.Item1.AddMetadata(provider.Item2, list, cancellationToken).ConfigureAwait(false); + await provider.Item1.AddMetadata(provider.Item2, enabledChannels, cancellationToken).ConfigureAwait(false); } catch (NotSupportedException) { From 67f698ea9619ba7ac0c805ab01f46b730c18942f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 16 Mar 2016 17:39:49 -0400 Subject: [PATCH 3/3] update sat discovery --- MediaBrowser.Model/LiveTv/LiveTvOptions.cs | 1 + .../LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs | 39 +++++++++++-------- .../LiveTv/TunerHosts/SatIp/SatIpHost.cs | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index f92a0c6e29..71f87ac3a3 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -33,6 +33,7 @@ namespace MediaBrowser.Model.LiveTv public bool ImportFavoritesOnly { get; set; } public bool IsEnabled { get; set; } public string M3UUrl { get; set; } + public string InfoUrl { get; set; } public string FriendlyName { get; set; } public int Tuners { get; set; } public string DiseqC { get; set; } diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs index 19b91a34f1..cdeb6dfa86 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs @@ -17,6 +17,7 @@ using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Extensions; namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp { @@ -64,26 +65,33 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp _logger.Debug("SAT IP found at {0}", location); // Just get the beginning of the url - AddDevice(location); + Uri uri; + if (Uri.TryCreate(location, UriKind.Absolute, out uri)) + { + var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase) + .TrimEnd('/'); + + AddDevice(apiUrl, location); + } } } } - private async void AddDevice(string location) + private async void AddDevice(string deviceUrl, string infoUrl) { await _semaphore.WaitAsync().ConfigureAwait(false); try { var options = GetConfiguration(); - - if (options.TunerHosts.Any(i => string.Equals(i.Type, SatIpHost.DeviceType, StringComparison.OrdinalIgnoreCase) && UriEquals(i.Url, location))) + + if (options.TunerHosts.Any(i => string.Equals(i.Type, SatIpHost.DeviceType, StringComparison.OrdinalIgnoreCase) && UriEquals(i.Url, deviceUrl))) { return; } - - _logger.Debug("Will attempt to add SAT device {0}", location); - var info = await GetInfo(location, CancellationToken.None).ConfigureAwait(false); + + _logger.Debug("Will attempt to add SAT device {0}", deviceUrl); + var info = await GetInfo(infoUrl, CancellationToken.None).ConfigureAwait(false); var existing = GetConfiguration().TunerHosts .FirstOrDefault(i => string.Equals(i.Type, SatIpHost.DeviceType, StringComparison.OrdinalIgnoreCase) && string.Equals(i.DeviceId, info.DeviceId, StringComparison.OrdinalIgnoreCase)); @@ -98,7 +106,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp await _liveTvManager.SaveTunerHost(new TunerHostInfo { Type = SatIpHost.DeviceType, - Url = location, + Url = deviceUrl, + InfoUrl = infoUrl, DataVersion = 1, DeviceId = info.DeviceId, FriendlyName = info.FriendlyName, @@ -110,14 +119,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp } else { - if (!string.Equals(existing.Url, location, StringComparison.OrdinalIgnoreCase)) - { - existing.Url = location; - existing.M3UUrl = info.M3UUrl; - existing.FriendlyName = info.FriendlyName; - existing.Tuners = info.Tuners; - await _liveTvManager.SaveTunerHost(existing).ConfigureAwait(false); - } + existing.Url = deviceUrl; + existing.InfoUrl = infoUrl; + existing.M3UUrl = info.M3UUrl; + existing.FriendlyName = info.FriendlyName; + existing.Tuners = info.Tuners; + await _liveTvManager.SaveTunerHost(existing).ConfigureAwait(false); } } catch (OperationCanceledException) diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs index 4bbb7e85ca..48acbfee3b 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpHost.cs @@ -116,7 +116,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp protected override async Task IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken) { - var updatedInfo = await SatIpDiscovery.Current.GetInfo(tuner.Url, cancellationToken).ConfigureAwait(false); + var updatedInfo = await SatIpDiscovery.Current.GetInfo(tuner.InfoUrl, cancellationToken).ConfigureAwait(false); return updatedInfo.TunersAvailable > 0; }