aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
diff options
context:
space:
mode:
authorLuis Miguel Almánzar <ruisu15@gmail.com>2013-11-02 21:19:33 -0400
committerLuis Miguel Almánzar <ruisu15@gmail.com>2013-11-02 21:19:33 -0400
commit8a0606e9704f98e368cea4a1391b21fb7e2dec03 (patch)
tree5e41e1d9925062fd90a7844e57d3f162ae3ae423 /MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
parentab490d7467967c40435828bb4fc6c0066955930c (diff)
strip only certain bracket blocks fixes #598
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/ResolverHelper.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/ResolverHelper.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
index 96057f8b7..f9b051cd5 100644
--- a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
+++ b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
@@ -71,7 +71,7 @@ namespace MediaBrowser.Server.Implementations.Library
/// <summary>
/// The MB name regex
/// </summary>
- private static readonly Regex MBNameRegex = new Regex("(\\[.*\\])", RegexOptions.Compiled);
+ private static readonly Regex MBNameRegex = new Regex(@"(\[boxset\]|\[tmdbid=\d+\]|\[tvdbid=\d+\])", RegexOptions.Compiled);
/// <summary>
/// Strip out attribute items and return just the name we will use for items
@@ -85,10 +85,15 @@ namespace MediaBrowser.Server.Implementations.Library
var fn = isDirectory ? Path.GetFileName(path) : Path.GetFileNameWithoutExtension(path);
//now - strip out anything inside brackets
- fn = MBNameRegex.Replace(fn, string.Empty);
+ fn = StripBrackets(fn);
return fn;
}
+ public static string StripBrackets(string inputString) {
+ var output = MBNameRegex.Replace(inputString, string.Empty).Trim();
+ return Regex.Replace(output, @"\s+", " ");
+ }
+
}
}