1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-02-02 11:34:39 +02:00

Fixed: Parse version after quality in renamed files

Closes #7302
This commit is contained in:
Mark McDowall 2024-10-26 20:56:27 -07:00 committed by Mark McDowall
parent 1fcfb88d2a
commit e88f25d3bf
2 changed files with 8 additions and 1 deletions

View File

@ -502,6 +502,13 @@ namespace NzbDrone.Core.Test.ParserTests
result.Revision.IsRepack.Should().Be(isRepack);
}
[TestCase("[MTBB] Series Title - S02E02 - 027 - Episode Title [WEBDL-1080p v2][x264][AAC]", 2)]
public void should_be_able_to_parse_anime_version(string title, int version)
{
var result = QualityParser.ParseQuality(title);
result.Revision.Version.Should().Be(version);
}
private void ParseAndVerifyQuality(string title, Quality quality, bool proper)
{
var result = QualityParser.ParseQuality(title);

View File

@ -40,7 +40,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[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)|(?:480|576|720|1080|2160)p[._ ]v(?<version>\d)",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",