diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-12 17:46:50 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-12 17:46:50 -0400 |
| commit | def34281994508213e5200fb150cdbcc817c55ab (patch) | |
| tree | c9233f3dce58987a3db389c90750ea5fa6d38096 /MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs | |
| parent | 455de48a65ddb9ac1fb5ff989b72f9735749a47e (diff) | |
Added poor man's multi-file movie support
Diffstat (limited to 'MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs index c54659453..a1b7be906 100644 --- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs +++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Entities; +using System.Text.RegularExpressions; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; using System; using System.Collections.Generic; @@ -45,6 +46,20 @@ namespace MediaBrowser.Controller.Resolvers ".mts" }; + private static readonly Regex MultiFileRegex = new Regex( + @"(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*[0-9]+)(.*?)(\.[^.]+)$", + RegexOptions.Compiled); + + /// <summary> + /// Determines whether [is multi part file] [the specified path]. + /// </summary> + /// <param name="path">The path.</param> + /// <returns><c>true</c> if [is multi part file] [the specified path]; otherwise, <c>false</c>.</returns> + public static bool IsMultiPartFile(string path) + { + return MultiFileRegex.Match(path).Success; + } + /// <summary> /// The audio file extensions /// </summary> |
