From 947d895fe8c1d5c6af43873af143a84d6d049c12 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 15 Feb 2016 00:47:23 -0500 Subject: stub out sat/ip discovery --- .../LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs | 64 ++++++++++------------ 1 file changed, 28 insertions(+), 36 deletions(-) (limited to 'MediaBrowser.Server.Implementations/LiveTv') diff --git a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs index 95c04d61f..08c42bb46 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/TunerHosts/SatIp/SatIpDiscovery.cs @@ -41,29 +41,21 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp void _deviceDiscovery_DeviceDiscovered(object sender, SsdpMessageEventArgs e) { - //string server = null; - //if (e.Headers.TryGetValue("SERVER", out server) && server.IndexOf("HDHomeRun", StringComparison.OrdinalIgnoreCase) != -1) - //{ - // string location; - // if (e.Headers.TryGetValue("Location", out location)) - // { - // //_logger.Debug("HdHomerun found at {0}", location); - - // // Just get the beginning of the url - // Uri uri; - // if (Uri.TryCreate(location, UriKind.Absolute, out uri)) - // { - // var apiUrl = location.Replace(uri.LocalPath, String.Empty, StringComparison.OrdinalIgnoreCase) - // .TrimEnd('/'); - - // //_logger.Debug("HdHomerun api url: {0}", apiUrl); - // AddDevice(apiUrl); - // } - // } - //} + string st = null; + if (e.Headers.TryGetValue("ST", out st) && string.Equals(st, "urn:ses-com:device:SatIPServer:1", StringComparison.OrdinalIgnoreCase)) + { + string location; + if (e.Headers.TryGetValue("Location", out location) && !string.IsNullOrWhiteSpace(location)) + { + _logger.Debug("SAT IP found at {0}", location); + + // Just get the beginning of the url + AddDevice(location); + } + } } - private async void AddDevice(string url) + private async void AddDevice(string location) { await _semaphore.WaitAsync().ConfigureAwait(false); @@ -71,24 +63,24 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp { var options = GetConfiguration(); - if (options.TunerHosts.Any(i => - string.Equals(i.Type, SatIpHost.DeviceType, StringComparison.OrdinalIgnoreCase) && - UriEquals(i.Url, url))) - { - return; - } + //if (options.TunerHosts.Any(i => + // string.Equals(i.Type, SatIpHost.DeviceType, StringComparison.OrdinalIgnoreCase) && + // UriEquals(i.Url, url))) + //{ + // return; + //} - // Strip off the port - url = new Uri(url).GetComponents(UriComponents.AbsoluteUri & ~UriComponents.Port, UriFormat.UriEscaped).TrimEnd('/'); + //// Strip off the port + //url = new Uri(url).GetComponents(UriComponents.AbsoluteUri & ~UriComponents.Port, UriFormat.UriEscaped).TrimEnd('/'); - await TestUrl(url).ConfigureAwait(false); - - await _liveTvManager.SaveTunerHost(new TunerHostInfo - { - Type = SatIpHost.DeviceType, - Url = url + //await TestUrl(url).ConfigureAwait(false); + + //await _liveTvManager.SaveTunerHost(new TunerHostInfo + //{ + // Type = SatIpHost.DeviceType, + // Url = url - }).ConfigureAwait(false); + //}).ConfigureAwait(false); } catch (Exception ex) { -- cgit v1.2.3 From 600aa7686586d3cfd9fae05f70456a7b3badc1c9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 15 Feb 2016 23:54:20 -0500 Subject: update recordings --- MediaBrowser.Api/PluginService.cs | 5 +++-- MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/LiveTv') diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index 2d7444f60..aead73def 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -208,7 +208,7 @@ namespace MediaBrowser.Api foreach (var plugin in result) { - var pkg = packages.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.guid) && new Guid(plugin.Id).Equals(new Guid(i.guid))); + var pkg = packages.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.guid) && string.Equals(i.guid.Replace("-", string.Empty), plugin.Id.Replace("-", string.Empty), StringComparison.OrdinalIgnoreCase)); if (pkg != null) { @@ -228,8 +228,9 @@ namespace MediaBrowser.Api .ToList(); } } - catch + catch (Exception ex) { + //Logger.ErrorException("Error getting plugin list", ex); // Play it safe here if (requireAppStoreEnabled) { diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index b4ff79567..5f4d32732 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -91,6 +91,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback StartStreamingLog(process.StandardError.BaseStream, _logFileStream); + onStarted(); + // Wait for the file to exist before proceeeding while (!_hasExited) { -- cgit v1.2.3