Fixed: Ignore repack version for MP3 V0/V2 VBR

pull/4418/head
Bogdan 4 months ago
parent 9e8b9bd38c
commit e6e50c8784

@ -310,9 +310,15 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Artist Title - Album Title 2017 REPACK FLAC aAF", true, 2)]
[TestCase("Artist.Title-Album.Title.2017.REPACK.FLAC-aAF", true, 2)]
[TestCase("Artist.Title-Album.Title.2017.REPACK2.FLAC-aAF", true, 3)]
[TestCase("Artist Title - Album Title 2017 RERIP FLAC aAF", true, 2)]
[TestCase("Artist Title - Album Title 2017 RERIP2 FLAC aAF", true, 3)]
[TestCase("Artist Title - Album Title 2017 PROPER FLAC aAF", false, 2)]
[TestCase("Artist.Title-Album.Title.2017.PROPER.FLAC-aAF", false, 2)]
[TestCase("Artist.Title-Album.Title.2017.RERIP.FLAC-DEMAND", true, 2)]
[TestCase("Artist.Title-Album.Title.2017.RERIP2.FLAC-DEMAND", true, 3)]
[TestCase("Artist Title - Album Title 2017 MP3 V2 (VBR) aAF", false, 1)]
[TestCase("Artist.Title-Album.Title.2017.MP3.V2.VBR-aAF", false, 1)]
[TestCase("Artist.Title-Album.Title.2017.MP3.V2.VBR-aAF", false, 1)]
[TestCase("Artist.Title-Album.Title.2017.MP3.V2.VBR-aAF", false, 1)]
[TestCase("Artist.Title-Album.Title.2017.MP3.V2.VBR-DEMAND", false, 1)]
[TestCase("Artist.Title-Album.Title.2017.MP3.V2.VBR-DEMAND", false, 1)]
public void should_be_able_to_parse_repack(string title, bool isRepack, int version)
{
var result = QualityParser.ParseQuality(title, null, 0);

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex RepackRegex = new (@"\b(?<repack>repack\d?|rerip\d?)\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex VersionRegex = new (@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
private static readonly Regex VersionRegex = new (@"(?:\d(?<!\bMP3\b))[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",

Loading…
Cancel
Save