aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-04 16:27:46 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-04 16:27:46 -0400
commit7990f9ca50c21be298d8fa90ce70015a80b976c3 (patch)
treea73baba29a1eed79446f4042ccf41d5c9cf78c56 /MediaBrowser.Server.Implementations
parent9ffb82d96a405fdb35cdd925d8ddbba716592fef (diff)
update connect
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs45
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json3
3 files changed, 30 insertions, 20 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
index 6dc83bc74..770eaa41f 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.Configuration;
+using System.Linq;
+using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Plugins;
@@ -38,34 +39,40 @@ namespace MediaBrowser.Server.Implementations.Connect
_timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3));
}
+ private readonly string[] _ipLookups = { "http://bot.whatismyipaddress.com", "https://connect.mediabrowser.tv/service/ip" };
+
private async void TimerCallback(object state)
{
- try
+ foreach (var ipLookupUrl in _ipLookups)
{
- using (var stream = await _httpClient.Get(new HttpRequestOptions
- {
- Url = "http://bot.whatismyipaddress.com/"
-
- }).ConfigureAwait(false))
+ try
{
- using (var reader = new StreamReader(stream))
+ using (var stream = await _httpClient.Get(new HttpRequestOptions
{
- var address = await reader.ReadToEndAsync().ConfigureAwait(false);
+ Url = ipLookupUrl
- if (IsValid(address))
+ }).ConfigureAwait(false))
+ {
+ using (var reader = new StreamReader(stream))
{
- ((ConnectManager)_connectManager).OnWanAddressResolved(address);
- CacheAddress(address);
+ var address = await reader.ReadToEndAsync().ConfigureAwait(false);
+
+ if (IsValid(address))
+ {
+ ((ConnectManager)_connectManager).OnWanAddressResolved(address);
+ CacheAddress(address);
+ return;
+ }
}
}
}
- }
- catch (HttpException)
- {
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error getting connection info", ex);
+ catch (HttpException)
+ {
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error getting connection info", ex);
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index 6e6be03a4..f6c69d8d6 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -664,6 +664,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var recording = (ILiveTvRecording)item;
+ recording.ExternalId = info.Id;
+
recording.ProgramId = _tvDtoService.GetInternalProgramId(serviceName, info.ProgramId).ToString("N");
recording.Audio = info.Audio;
recording.ChannelType = info.ChannelType;
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index c4100f219..1ccf21119 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -800,5 +800,6 @@
"HeaderYouSaid": "You Said...",
"MessageWeDidntRecognizeCommand": "We're sorry, we didn't recognize that command.",
"MessageIfYouBlockedVoice": "If you denied voice access to the app you'll need to reconfigure before trying again.",
- "MessageNoItemsFound": "No items found."
+ "MessageNoItemsFound": "No items found.",
+ "ButtonManageServer": "Manage Server"
}