Fixed: Parse JAP instead of JPN as Japanese

This commit is contained in:
Bogdan 2025-04-13 12:25:46 +03:00
parent e5137d13e9
commit 445babbca8
3 changed files with 4 additions and 4 deletions

View file

@ -135,8 +135,8 @@ public void should_parse_language_dutch(string postTitle)
}
[TestCase("Movie.Title.1994.Japanese.1080p.XviD-LOL")]
[TestCase("Movie.Title (1988) 2160p HDR 5.1 Eng - Jpn x265 10bit")]
[TestCase("Movie Title (1985) (1080p.AC3 ITA-ENG-JPN)")]
[TestCase("Movie.Title (1988) 2160p HDR 5.1 Eng - Jap x265 10bit")]
[TestCase("Movie Title (1985) (1080p.AC3 ITA-ENG-JAP)")]
public void should_parse_language_japanese(string postTitle)
{
var result = Parser.Parser.ParseMovieTitle(postTitle, true);

View file

@ -35,7 +35,7 @@ public static class LanguageParser
(?<latvian>\b(?:lat|lav|lv)\b)|
(?<telugu>\btel\b)|
(?<vietnamese>\bVIE\b)|
(?<japanese>\bJPN\b)|
(?<japanese>\bJAP\b)|
(?<korean>\bKOR\b)|
(?<urdu>\burdu\b)|
(?<original>\b(?:orig|original)\b)",

View file

@ -142,7 +142,7 @@ public static class Parser
private static readonly Regex CleanQualityBracketsRegex = new Regex(@"\[[a-z0-9 ._-]+\]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+(?<part2>-[a-z0-9]+)?(?!.+?(?:480p|576p|720p|1080p|2160p)))(?<!(?:WEB-(DL|Rip)|Blu-Ray|480p|576p|720p|1080p|2160p|DTS-HD|DTS-X|DTS-MA|DTS-ES|-ES|-EN|-CAT|-ENG|-JPN|-GER|-FRA|-FRE|-ITA|-HDRip|\d{1,2}-bit|[ ._]\d{4}-\d{2}|-\d{2}|tmdb(id)?-(?<tmdbid>\d+)|(?<imdbid>tt\d{7,8}))(?:\k<part2>)?)(?:\b|[-._ ]|$)|[-._ ]\[(?<releasegroup>[a-z0-9]+)\]$",
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+(?<part2>-[a-z0-9]+)?(?!.+?(?:480p|576p|720p|1080p|2160p)))(?<!(?:WEB-(DL|Rip)|Blu-Ray|480p|576p|720p|1080p|2160p|DTS-HD|DTS-X|DTS-MA|DTS-ES|-ES|-EN|-CAT|-ENG|-JAP|-GER|-FRA|-FRE|-ITA|-HDRip|\d{1,2}-bit|[ ._]\d{4}-\d{2}|-\d{2}|tmdb(id)?-(?<tmdbid>\d+)|(?<imdbid>tt\d{7,8}))(?:\k<part2>)?)(?:\b|[-._ ]|$)|[-._ ]\[(?<releasegroup>[a-z0-9]+)\]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex InvalidReleaseGroupRegex = new Regex(@"^([se]\d+|[0-9a-f]{8})$", RegexOptions.IgnoreCase | RegexOptions.Compiled);