add imdbid detection from media file

This commit is contained in:
GuzziMP
2015-01-02 15:29:20 +01:00
parent 767590125b
commit 5d4c53522b
2 changed files with 24 additions and 5 deletions

View File

@@ -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;
}
}