Skip to content

Commit

Permalink
Fixed: Ignore repack version for MP3 V0/V2 VBR
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan committed Jan 9, 2024
1 parent 9e8b9bd commit e6e50c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs
Expand Up @@ -310,9 +310,15 @@ public void should_parse_null_quality_description_as_unknown()
[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);
Expand Down
2 changes: 1 addition & 1 deletion src/NzbDrone.Core/Parser/QualityParser.cs
Expand Up @@ -18,7 +18,7 @@ public class QualityParser
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",
Expand Down

0 comments on commit e6e50c8

Please sign in to comment.