aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
diff options
context:
space:
mode:
authorGuzziMP <GuzziMP@web.de>2015-01-02 15:29:20 +0100
committerGuzziMP <GuzziMP@web.de>2015-01-02 15:29:20 +0100
commit5d4c53522bb0b723047455ec308095e85cb104e8 (patch)
tree42cadad927c588ba81dbbcbf541addb3f08886ae /MediaBrowser.Server.Implementations/Library/PathExtensions.cs
parent767590125b27c2498e3ad9544edbede30fb70f45 (diff)
add imdbid detection from media file
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;
}
}