mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
update connect
This commit is contained in:
@@ -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
|
||||
try
|
||||
{
|
||||
Url = "http://bot.whatismyipaddress.com/"
|
||||
|
||||
}).ConfigureAwait(false))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user