From 6f7d7e61b911518aadcd6dc0b061d0eafd8a7acf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 2 Jun 2015 23:16:39 -0400 Subject: add logging to connect reporting --- .../Connect/ConnectEntryPoint.cs | 7 ++++++- MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 52ec5c9b12..3e211d003e 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.Net; using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Logging; +using MediaBrowser.Model.Net; using System; using System.IO; using System.Net; @@ -59,9 +60,13 @@ namespace MediaBrowser.Server.Implementations.Connect } } } - catch + catch (HttpException) { } + catch (Exception ex) + { + _logger.ErrorException("Error getting connection info", ex); + } } private string CacheFilePath diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 2d39f760e8..048287faa4 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -130,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Connect UpdateConnectInfo(); } - private async void UpdateConnectInfo() + private async Task UpdateConnectInfo() { await _operationLock.WaitAsync().ConfigureAwait(false); @@ -399,6 +399,10 @@ namespace MediaBrowser.Server.Implementations.Connect throw new ArgumentNullException("connectUsername"); } if (string.IsNullOrWhiteSpace(ConnectServerId)) + { + await UpdateConnectInfo().ConfigureAwait(false); + } + if (string.IsNullOrWhiteSpace(ConnectServerId)) { throw new ArgumentNullException("ConnectServerId"); } @@ -492,6 +496,10 @@ namespace MediaBrowser.Server.Implementations.Connect throw new ArgumentNullException("connectUsername"); } if (string.IsNullOrWhiteSpace(ConnectServerId)) + { + await UpdateConnectInfo().ConfigureAwait(false); + } + if (string.IsNullOrWhiteSpace(ConnectServerId)) { throw new ArgumentNullException("ConnectServerId"); } -- cgit v1.2.3 From 5c5d7d034b0943d00c9f92085368e7a372462212 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 3 Jun 2015 11:26:39 -0400 Subject: add more sync indicators --- MediaBrowser.Api/Images/ImageService.cs | 12 ++++++++++-- .../Connect/ConnectManager.cs | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 8c6cc0a18e..b8ea621375 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -675,10 +675,18 @@ namespace MediaBrowser.Api.Images private ImageFormat[] GetClientSupportedFormats() { - if ((Request.AcceptTypes ?? new string[] { }).Contains("image/webp", StringComparer.OrdinalIgnoreCase)) + var supportsWebP = (Request.AcceptTypes ?? new string[] {}).Contains("image/webp", StringComparer.OrdinalIgnoreCase); + + var userAgent = Request.UserAgent ?? string.Empty; + + if (userAgent.IndexOf("crosswalk", StringComparison.OrdinalIgnoreCase) != -1 && + userAgent.IndexOf("android", StringComparison.OrdinalIgnoreCase) != -1) { - var userAgent = Request.UserAgent ?? string.Empty; + supportsWebP = true; + } + if (supportsWebP) + { // Not displaying properly on iOS if (userAgent.IndexOf("cfnetwork", StringComparison.OrdinalIgnoreCase) == -1) { diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 048287faa4..4569503c01 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -376,6 +376,11 @@ namespace MediaBrowser.Server.Implementations.Connect public async Task LinkUser(string userId, string connectUsername) { + if (string.IsNullOrWhiteSpace(ConnectServerId)) + { + await UpdateConnectInfo().ConfigureAwait(false); + } + await _operationLock.WaitAsync().ConfigureAwait(false); try @@ -399,10 +404,6 @@ namespace MediaBrowser.Server.Implementations.Connect throw new ArgumentNullException("connectUsername"); } if (string.IsNullOrWhiteSpace(ConnectServerId)) - { - await UpdateConnectInfo().ConfigureAwait(false); - } - if (string.IsNullOrWhiteSpace(ConnectServerId)) { throw new ArgumentNullException("ConnectServerId"); } @@ -474,6 +475,11 @@ namespace MediaBrowser.Server.Implementations.Connect public async Task InviteUser(ConnectAuthorizationRequest request) { + if (string.IsNullOrWhiteSpace(ConnectServerId)) + { + await UpdateConnectInfo().ConfigureAwait(false); + } + await _operationLock.WaitAsync().ConfigureAwait(false); try @@ -496,10 +502,6 @@ namespace MediaBrowser.Server.Implementations.Connect throw new ArgumentNullException("connectUsername"); } if (string.IsNullOrWhiteSpace(ConnectServerId)) - { - await UpdateConnectInfo().ConfigureAwait(false); - } - if (string.IsNullOrWhiteSpace(ConnectServerId)) { throw new ArgumentNullException("ConnectServerId"); } -- cgit v1.2.3 From 9ffb82d96a405fdb35cdd925d8ddbba716592fef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Jun 2015 00:50:10 -0400 Subject: remove probing of live tv feeds --- .../Connect/ConnectEntryPoint.cs | 11 +++++++++-- .../LiveTv/LiveTvMediaSourceProvider.cs | 20 -------------------- .../Localization/JavaScript/javascript.json | 1 + .../Localization/Server/server.json | 3 ++- 4 files changed, 12 insertions(+), 23 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 3e211d003e..6dc83bc74d 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -54,7 +54,7 @@ namespace MediaBrowser.Server.Implementations.Connect if (IsValid(address)) { - ((ConnectManager) _connectManager).OnWanAddressResolved(address); + ((ConnectManager)_connectManager).OnWanAddressResolved(address); CacheAddress(address); } } @@ -115,7 +115,14 @@ namespace MediaBrowser.Server.Implementations.Connect private bool IsValid(string address) { IPAddress ipAddress; - return IPAddress.TryParse(address, out ipAddress); + var valid = IPAddress.TryParse(address, out ipAddress); + + if (!valid) + { + _logger.Error("{0} is not a valid ip address", address); + } + + return valid; } public void Dispose() diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs index 4a9028af4e..b267324411 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs @@ -3,7 +3,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; @@ -137,25 +136,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv { var originalRuntime = mediaSource.RunTimeTicks; - var info = await _mediaEncoder.GetMediaInfo(new MediaInfoRequest - { - InputPath = mediaSource.Path, - Protocol = mediaSource.Protocol, - MediaType = isAudio ? DlnaProfileType.Audio : DlnaProfileType.Video, - ExtractChapters = false - - }, cancellationToken).ConfigureAwait(false); - - mediaSource.Bitrate = info.Bitrate; - mediaSource.Container = info.Container; - mediaSource.Formats = info.Formats; - mediaSource.MediaStreams = info.MediaStreams; - mediaSource.RunTimeTicks = info.RunTimeTicks; - mediaSource.Size = info.Size; - mediaSource.Timestamp = info.Timestamp; - mediaSource.Video3DFormat = info.Video3DFormat; - mediaSource.VideoType = info.VideoType; - mediaSource.DefaultSubtitleStreamIndex = null; // Null this out so that it will be treated like a live stream diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index d2815b4af5..c4100f2194 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -786,6 +786,7 @@ "ButtonUnlockWithSupporter": "Sign in with Emby Supporter Membership", "MessagePleaseSignInLocalNetwork": "Before proceeding, please ensure that you're connected to your local network using a Wifi or LAN connection.", "ButtonUnlockWithPurchase": "Unlock with Purchase", + "ButtonUnlockPrice": "Unlock {0}", "MessageLiveTvGuideRequiresUnlock": "The Live TV Guide is currently limited to {0} channels. Click the unlock button to learn how to enjoy the full experience.", "OptionEnableFullscreen": "Enable Fullscreen", "ButtonServer": "Server", diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index ea4893ebfd..f37eeed53c 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1452,5 +1452,6 @@ "HeaderColumns": "Columns", "ButtonReset": "Reset", "OptionEnableExternalVideoPlayers": "Enable external video players", - "ButtonUnlockGuide": "Unlock Guide" + "ButtonUnlockGuide": "Unlock Guide", + "LabelEnableFullScreen": "Enable fullScreen mode" } -- cgit v1.2.3 From 7990f9ca50c21be298d8fa90ce70015a80b976c3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Jun 2015 16:27:46 -0400 Subject: update connect --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 6 +++ MediaBrowser.Controller/LiveTv/ILiveTvItem.cs | 1 + .../Music/FanArtArtistProvider.cs | 2 +- .../TV/FanArtTvUpdatesPostScanTask.cs | 2 +- .../Connect/ConnectEntryPoint.cs | 45 +++++++++++++--------- .../LiveTv/LiveTvManager.cs | 2 + .../Localization/JavaScript/javascript.json | 3 +- .../MediaBrowser.WebDashboard.csproj | 6 +++ 8 files changed, 45 insertions(+), 22 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index a19b66af60..c0917b8df7 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1768,6 +1768,12 @@ namespace MediaBrowser.Api.Playback state.InputAudioSync = "1"; } + if (string.Equals(mediaSource.Container, "wma", StringComparison.OrdinalIgnoreCase)) + { + // Seeing some stuttering when transcoding wma to audio-only HLS + state.InputAudioSync = "1"; + } + var mediaStreams = mediaSource.MediaStreams; if (videoRequest != null) diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs b/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs index 313675fb79..36727f4aee 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs @@ -5,5 +5,6 @@ namespace MediaBrowser.Controller.LiveTv public interface ILiveTvItem : IHasId { string ServiceName { get; set; } + string ExternalId { get; set; } } } diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs index 0ed654962c..597c5c0bc7 100644 --- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs @@ -8,6 +8,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; +using MediaBrowser.Providers.TV; using System; using System.Collections.Generic; using System.Globalization; @@ -17,7 +18,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Xml; -using MediaBrowser.Providers.TV; namespace MediaBrowser.Providers.Music { diff --git a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs index 115b80434c..64c6488fbe 100644 --- a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs +++ b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs @@ -130,7 +130,7 @@ namespace MediaBrowser.Providers.TV { var json = await reader.ReadToEndAsync().ConfigureAwait(false); - if (string.Equals(json, "null", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(json, "null", StringComparison.OrdinalIgnoreCase) || string.IsNullOrWhiteSpace(json)) { return new List(); } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 6dc83bc74d..770eaa41f1 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 6e6be03a49..f6c69d8d69 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 c4100f2194..1ccf211193 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" } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 71f1f34158..48cd3f2340 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -90,6 +90,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -123,6 +126,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From 67c4c9381f3c56f44d7ecadb3b95f72929b8af6e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 11 Jun 2015 17:22:44 -0400 Subject: 3.0.5641.0 --- .../Subtitles/ISubtitleProvider.cs | 8 +++++ .../Subtitles/OpenSubtitleDownloader.cs | 36 ++++++++++++++++++---- MediaBrowser.Providers/TV/TvdbSeriesProvider.cs | 24 +++++++-------- .../Connect/ConnectEntryPoint.cs | 9 ++++-- SharedVersion.cs | 4 +-- 5 files changed, 58 insertions(+), 23 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Connect') diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs index dceea0cc69..5cb106fec1 100644 --- a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs +++ b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs @@ -1,4 +1,5 @@ using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Dto; using MediaBrowser.Model.Providers; using System.Collections.Generic; using System.Threading; @@ -35,5 +36,12 @@ namespace MediaBrowser.Controller.Subtitles /// The cancellation token. /// Task{SubtitleResponse}. Task GetSubtitles(string id, CancellationToken cancellationToken); + + /// + /// Gets the supported languages. + /// + /// The cancellation token. + /// Task<IEnumerable<NameIdPair>>. + Task> GetSupportedLanguages(CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs index 289c5661fb..54db0d5faa 100644 --- a/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs +++ b/MediaBrowser.Providers/Subtitles/OpenSubtitleDownloader.cs @@ -5,10 +5,11 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Security; using MediaBrowser.Controller.Subtitles; -using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Providers; +using MediaBrowser.Model.Serialization; using OpenSubtitlesHandler; using System; using System.Collections.Generic; @@ -38,17 +39,23 @@ namespace MediaBrowser.Providers.Subtitles // And the user may restart the server private const int MaxDownloadsPerDay = 150; - public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption) + private readonly IJsonSerializer _json; + + public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption, IJsonSerializer json) { _logger = logManager.GetLogger(GetType().Name); _httpClient = httpClient; _config = config; _encryption = encryption; + _json = json; _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating; // Reset the count every 24 hours _dailyTimer = new Timer(state => _dailyDownloadCount = 0, null, TimeSpan.FromHours(24), TimeSpan.FromHours(24)); + + Utilities.HttpClient = httpClient; + OpenSubtitles.SetUserAgent("mediabrowser.tv"); } private const string PasswordHashPrefix = "h:"; @@ -195,6 +202,26 @@ namespace MediaBrowser.Providers.Subtitles _lastLogin = DateTime.UtcNow; } + public async Task> GetSupportedLanguages(CancellationToken cancellationToken) + { + await Login(cancellationToken).ConfigureAwait(false); + + var result = OpenSubtitles.GetSubLanguages("en"); + if (!(result is MethodResponseGetSubLanguages)) + { + _logger.Error("Invalid response type"); + return new List(); + } + + var results = ((MethodResponseGetSubLanguages)result).Languages; + + return results.Select(i => new NameIdPair + { + Name = i.LanguageName, + Id = i.SubLanguageID + }); + } + public async Task> Search(SubtitleSearchRequest request, CancellationToken cancellationToken) { var imdbIdText = request.GetProviderId(MetadataProviders.Imdb); @@ -229,9 +256,6 @@ namespace MediaBrowser.Providers.Subtitles return new List(); } - Utilities.HttpClient = _httpClient; - OpenSubtitles.SetUserAgent("mediabrowser.tv"); - await Login(cancellationToken).ConfigureAwait(false); var subLanguageId = request.Language; @@ -260,7 +284,7 @@ namespace MediaBrowser.Providers.Subtitles var result = await OpenSubtitles.SearchSubtitlesAsync(parms.ToArray(), cancellationToken).ConfigureAwait(false); if (!(result is MethodResponseSubtitleSearch)) { - _logger.Debug("Invalid response type"); + _logger.Error("Invalid response type"); return new List(); } diff --git a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs index 60e484a36d..8bdd914df5 100644 --- a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs @@ -398,21 +398,21 @@ namespace MediaBrowser.Providers.TV } } - if (titles.Any(t => string.Equals(t, comparableName, StringComparison.OrdinalIgnoreCase))) + foreach (var title in titles) { - var id = node.SelectSingleNode("./seriesid") ?? - node.SelectSingleNode("./id"); - - if (id != null) + if (string.Equals(title, comparableName, StringComparison.OrdinalIgnoreCase)) { - searchResult.Name = titles.FirstOrDefault(); - searchResult.SetProviderId(MetadataProviders.Tvdb, id.InnerText); - searchResults.Add(searchResult); - } - } + var id = node.SelectSingleNode("./seriesid") ?? + node.SelectSingleNode("./id"); - foreach (var title in titles) - { + if (id != null) + { + searchResult.Name = title; + searchResult.SetProviderId(MetadataProviders.Tvdb, id.InnerText); + searchResults.Add(searchResult); + } + break; + } _logger.Info("TVDb Provider - " + title + " did not match " + comparableName); } } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 770eaa41f1..973519a77e 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -1,4 +1,4 @@ -using System.Linq; +using MediaBrowser.Common; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Connect; @@ -22,14 +22,16 @@ namespace MediaBrowser.Server.Implementations.Connect private readonly IConnectManager _connectManager; private readonly INetworkManager _networkManager; + private readonly IApplicationHost _appHost; - public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager) + public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager, IApplicationHost appHost) { _httpClient = httpClient; _appPaths = appPaths; _logger = logger; _networkManager = networkManager; _connectManager = connectManager; + _appHost = appHost; } public void Run() @@ -49,7 +51,8 @@ namespace MediaBrowser.Server.Implementations.Connect { using (var stream = await _httpClient.Get(new HttpRequestOptions { - Url = ipLookupUrl + Url = ipLookupUrl, + UserAgent = "Emby Server/" + _appHost.ApplicationVersion }).ConfigureAwait(false)) { diff --git a/SharedVersion.cs b/SharedVersion.cs index c576e56f1c..c81991d9a7 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("3.0.*")] -//[assembly: AssemblyVersion("3.0.5621.4")] +//[assembly: AssemblyVersion("3.0.*")] +[assembly: AssemblyVersion("3.0.5641.0")] -- cgit v1.2.3