MultiDiscAlbumTests.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Emby.Naming.Audio;
  2. using Emby.Naming.Common;
  3. using Xunit;
  4. namespace Jellyfin.Naming.Tests.Music
  5. {
  6. public class MultiDiscAlbumTests
  7. {
  8. private readonly NamingOptions _namingOptions = new NamingOptions();
  9. [Theory]
  10. [InlineData("", false)]
  11. [InlineData("C:/", false)]
  12. [InlineData("/home/", false)]
  13. [InlineData(@"blah blah", false)]
  14. [InlineData(@"D:/music/weezer/03 Pinkerton", false)]
  15. [InlineData(@"D:/music/michael jackson/Bad (2012 Remaster)", false)]
  16. [InlineData(@"cd1", true)]
  17. [InlineData(@"disc18", true)]
  18. [InlineData(@"disk10", true)]
  19. [InlineData(@"vol7", true)]
  20. [InlineData(@"volume1", true)]
  21. [InlineData(@"cd 1", true)]
  22. [InlineData(@"disc 1", true)]
  23. [InlineData(@"disk 1", true)]
  24. [InlineData(@"disk", false)]
  25. [InlineData(@"disk ·", false)]
  26. [InlineData(@"disk a", false)]
  27. [InlineData(@"disk volume", false)]
  28. [InlineData(@"disc disc", false)]
  29. [InlineData(@"disk disc 6", false)]
  30. [InlineData(@"cd - 1", true)]
  31. [InlineData(@"disc- 1", true)]
  32. [InlineData(@"disk - 1", true)]
  33. [InlineData(@"Disc 01 (Hugo Wolf · 24 Lieder)", true)]
  34. [InlineData(@"Disc 04 (Encores and Folk Songs)", true)]
  35. [InlineData(@"Disc04 (Encores and Folk Songs)", true)]
  36. [InlineData(@"Disc 04(Encores and Folk Songs)", true)]
  37. [InlineData(@"Disc04(Encores and Folk Songs)", true)]
  38. [InlineData(@"D:/Video/MBTestLibrary/VideoTest/music/.38 special/anth/Disc 2", true)]
  39. [InlineData(@"[1985] Opportunities (Let's make lots of money) (1985)", false)]
  40. [InlineData(@"Blah 04(Encores and Folk Songs)", false)]
  41. public void AlbumParser_MultidiscPath_Identifies(string path, bool result)
  42. {
  43. var parser = new AlbumParser(_namingOptions);
  44. Assert.Equal(result, parser.IsMultiPart(path));
  45. }
  46. }
  47. }