2019-12-06 19:40:06 +00:00
|
|
|
|
using Emby.Naming.Audio;
|
|
|
|
|
using Emby.Naming.Common;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Naming.Tests.Music
|
|
|
|
|
{
|
|
|
|
|
public class MultiDiscAlbumTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestMultiDiscAlbums()
|
|
|
|
|
{
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"blah blah"));
|
2020-01-18 15:18:55 +00:00
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"D:/music/weezer/03 Pinkerton"));
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"D:/music/michael jackson/Bad (2012 Remaster)"));
|
2019-12-06 19:40:06 +00:00
|
|
|
|
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"cd1"));
|
2020-01-18 15:18:55 +00:00
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disc18"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disk10"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"vol7"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"volume1"));
|
2019-12-06 19:40:06 +00:00
|
|
|
|
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"cd 1"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disc 1"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disk 1"));
|
|
|
|
|
|
2020-01-18 15:18:55 +00:00
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disk"));
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disk ·"));
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disk a"));
|
|
|
|
|
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disk volume"));
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disc disc"));
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"disk disc 6"));
|
|
|
|
|
|
2019-12-06 19:40:06 +00:00
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"cd - 1"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disc- 1"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"disk - 1"));
|
|
|
|
|
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"Disc 01 (Hugo Wolf · 24 Lieder)"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"Disc 04 (Encores and Folk Songs)"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"Disc04 (Encores and Folk Songs)"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"Disc 04(Encores and Folk Songs)"));
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"Disc04(Encores and Folk Songs)"));
|
|
|
|
|
|
|
|
|
|
Assert.True(IsMultiDiscAlbumFolder(@"D:/Video/MBTestLibrary/VideoTest/music/.38 special/anth/Disc 2"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestMultiDiscAlbums1()
|
|
|
|
|
{
|
2020-01-18 15:18:55 +00:00
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"[1985] Opportunities (Let's make lots of money) (1985)"));
|
2019-12-06 19:40:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestMultiDiscAlbums2()
|
|
|
|
|
{
|
|
|
|
|
Assert.False(IsMultiDiscAlbumFolder(@"Blah 04(Encores and Folk Songs)"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsMultiDiscAlbumFolder(string path)
|
|
|
|
|
{
|
|
|
|
|
var parser = new AlbumParser(new NamingOptions());
|
|
|
|
|
|
2020-01-22 21:18:56 +00:00
|
|
|
|
return parser.IsMultiPart(path);
|
2019-12-06 19:40:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|