Przeglądaj źródła

Merge pull request #2915 from randrey/imdbid-length-fix

Fix imdbid regex

(cherry picked from commit 6f866a7fdcd406e67892ad7e69b6a152a7d3cbe9)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
Bond-009 5 lat temu
rodzic
commit
77f72dc607

+ 1 - 1
Emby.Server.Implementations/Library/PathExtensions.cs

@@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Library
             // for imdbid we also accept pattern matching
             if (string.Equals(attrib, "imdbid", StringComparison.OrdinalIgnoreCase))
             {
-                var m = Regex.Match(str, "tt\\d{7}", RegexOptions.IgnoreCase);
+                var m = Regex.Match(str, "tt([0-9]{7,8})", RegexOptions.IgnoreCase);
                 return m.Success ? m.Value : null;
             }
 

+ 2 - 2
MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs

@@ -203,8 +203,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
 
         protected void ParseProviderLinks(T item, string xml)
         {
-            //Look for a match for the Regex pattern "tt" followed by 7 digits
-            var m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase);
+            // Look for a match for the Regex pattern "tt" followed by 7 or 8 digits
+            var m = Regex.Match(xml, "tt([0-9]{7,8})", RegexOptions.IgnoreCase);
             if (m.Success)
             {
                 item.SetProviderId(MetadataProviders.Imdb, m.Value);