From a9f2a72d0b87115185a82aa2245aef1ea2e2b59f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 19 Jan 2014 01:36:21 -0500 Subject: #680 - Support new episode file sorting --- MediaBrowser.Controller/Library/TVUtils.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'MediaBrowser.Controller/Library') 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; + } + /// /// Gets the air days. /// -- cgit v1.2.3