mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
strip all bracket tags. fixes #598
This commit is contained in:
parent
ce8821c942
commit
7c45cb3aa5
2 changed files with 5 additions and 5 deletions
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The MB name regex
|
/// The MB name regex
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static readonly Regex MBNameRegex = new Regex(@"(\[boxset\]|\[tmdbid=\d+\]|\[tvdbid=\d+\])", RegexOptions.Compiled);
|
private static readonly Regex MBNameRegex = new Regex(@"(\[.*?\])", RegexOptions.Compiled);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Strip out attribute items and return just the name we will use for items
|
/// Strip out attribute items and return just the name we will use for items
|
||||||
|
|
|
@ -8,10 +8,10 @@ namespace MediaBrowser.Tests.Server.Implementations.Library {
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestStripBrackets()
|
public void TestStripBrackets()
|
||||||
{
|
{
|
||||||
Assert.AreEqual("My Movie [blah blah]", ResolverHelper.StripBrackets("My Movie [boxset] [blah blah]"));
|
Assert.AreEqual("My Movie", ResolverHelper.StripBrackets("My Movie [boxset] [blah blah]"));
|
||||||
Assert.AreEqual("[tag1] file 01", ResolverHelper.StripBrackets("[tag1] file 01 [tvdbid=12345]"));
|
Assert.AreEqual("file 01", ResolverHelper.StripBrackets("[tag1] file 01 [tvdbid=12345]"));
|
||||||
Assert.AreEqual("[tag1] file 01", ResolverHelper.StripBrackets("[tag1] file 01 [tmdbid=12345]"));
|
Assert.AreEqual("file 01", ResolverHelper.StripBrackets("[tag1] file 01 [tmdbid=12345]"));
|
||||||
Assert.AreEqual("[tag1] file 01", ResolverHelper.StripBrackets("[tag1] file [boxset] [tvdbid=12345] 01 [tmdbid=12345]"));
|
Assert.AreEqual("file 01", ResolverHelper.StripBrackets("[tag1] file [boxset] [tvdbid=12345] 01 [tmdbid=12345]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue