aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/PathExtensions.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/PathExtensions.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/PathExtensions.cs b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
index 00bd65125..822f41da2 100644
--- a/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
+++ b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
@@ -1,4 +1,5 @@
using System;
+using System.Text.RegularExpressions;
namespace MediaBrowser.Server.Implementations.Library
{
@@ -31,6 +32,14 @@ namespace MediaBrowser.Server.Implementations.Library
int end = str.IndexOf(']', start);
return str.Substring(start, end - start);
}
+ // for imdbid we also accept pattern matching
+ if (attrib == "imdbid")
+ {
+ Regex imdbPattern = new Regex("tt\\d{7}");
+ var m = imdbPattern.Match(str);
+ return m.Success ? m.Value : null;
+ }
+
return null;
}
}