mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 13:54:29 +00:00
Fixed: Parse year in title from square brackets
(cherry picked from commit 99e60196a4e513d6340a090de4a5517f205e7a29)
This commit is contained in:
parent
df681d82be
commit
d98c86c3d9
2 changed files with 2 additions and 1 deletions
|
@ -215,6 +215,7 @@ public void should_parse_movie_folder_name(string postTitle, string title)
|
|||
[TestCase("Movie Name FRENCH BluRay 720p 2016 kjhlj", 2016)]
|
||||
[TestCase("Der.Movie.German.Bluray.FuckYou.Pso.Why.cant.you.follow.scene.rules.1998", 1998)]
|
||||
[TestCase("Movie Name (1897) [DVD].mp4", 1897)]
|
||||
[TestCase("World Movie Z Movie [2023]", 2023)]
|
||||
public void should_parse_movie_year(string postTitle, int year)
|
||||
{
|
||||
Parser.Parser.ParseMovieTitle(postTitle).Year.Should().Be(year);
|
||||
|
|
|
@ -144,7 +144,7 @@ public static class Parser
|
|||
private static readonly Regex AnimeReleaseGroupRegex = new Regex(@"^(?:\[(?<subgroup>(?!\s).+?(?<!\s))\](?:_|-|\s|\.)?)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex YearInTitleRegex = new Regex(@"^(?<title>.+?)(?:\W|_)?(?<year>\d{4})",
|
||||
private static readonly Regex YearInTitleRegex = new Regex(@"^(?<title>.+?)(?:\W|_.)?[\(\[]?(?<year>\d{4})[\]\)]?",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
// Handle Exception Release Groups that don't follow -RlsGrp; Manual List
|
||||
|
|
Loading…
Reference in a new issue