diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-19 01:36:21 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-19 01:36:21 -0500 |
| commit | a9f2a72d0b87115185a82aa2245aef1ea2e2b59f (patch) | |
| tree | 173238df9e4f3f9a943b2d91e8ba521c9d96cd20 /MediaBrowser.Controller | |
| parent | d2cae4012853bb6457554516f06e5bbf11121b8d (diff) | |
#680 - Support new episode file sorting
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Library/TVUtils.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 67d78fa89..54ebf8914 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -331,6 +331,30 @@ namespace MediaBrowser.Controller.Library return null; } + public static string GetSeriesNameFromEpisodeFile(string fullPath) + { + var fl = fullPath.ToLower(); + foreach (var r in EpisodeExpressions) + { + var m = r.Match(fl); + if (m.Success) + { + var g = m.Groups["seriesname"]; + if (g != null) + { + var val = g.Value; + + if (!string.IsNullOrWhiteSpace(val)) + { + return val; + } + } + return null; + } + } + return null; + } + /// <summary> /// Gets the air days. /// </summary> |
