From 5a5ec56328ef3a6ac551543e17a0f0b0e0492cef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Jan 2015 09:34:15 -0500 Subject: [PATCH] adjust imdb id parsing --- .../EntryPoints/UsageEntryPoint.cs | 3 +- .../Library/PathExtensions.cs | 9 ++-- .../Library/Resolvers/Movies/MovieResolver.cs | 43 ++++++++++--------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/MediaBrowser.Server.Implementations/EntryPoints/UsageEntryPoint.cs b/MediaBrowser.Server.Implementations/EntryPoints/UsageEntryPoint.cs index 0e99ee673..dac0b0d15 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/UsageEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/UsageEntryPoint.cs @@ -29,13 +29,14 @@ namespace MediaBrowser.Server.Implementations.EntryPoints private readonly ConcurrentDictionary _apps = new ConcurrentDictionary(); - public UsageEntryPoint(ILogger logger, IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient, ISessionManager sessionManager) + public UsageEntryPoint(ILogger logger, IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient, ISessionManager sessionManager, IUserManager userManager) { _logger = logger; _applicationHost = applicationHost; _networkManager = networkManager; _httpClient = httpClient; _sessionManager = sessionManager; + _userManager = userManager; _sessionManager.SessionStarted += _sessionManager_SessionStarted; } diff --git a/MediaBrowser.Server.Implementations/Library/PathExtensions.cs b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs index 822f41da2..6c0e3237e 100644 --- a/MediaBrowser.Server.Implementations/Library/PathExtensions.cs +++ b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs @@ -33,13 +33,12 @@ namespace MediaBrowser.Server.Implementations.Library return str.Substring(start, end - start); } // for imdbid we also accept pattern matching - if (attrib == "imdbid") + if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase)) { - Regex imdbPattern = new Regex("tt\\d{7}"); - var m = imdbPattern.Match(str); - return m.Success ? m.Value : null; + var m = Regex.Match(str, "tt\\d{7}", RegexOptions.IgnoreCase); + return m.Success ? m.Value : null; } - + return null; } } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 5ecf7759d..441fada6a 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -19,7 +19,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies /// public class MovieResolver : BaseVideoResolver