Fixed: Don't Parse TMDb id and IMDb id as group

pull/5870/head
bakerboy448 4 years ago committed by Qstick
parent 566c1405c2
commit 012fe53acc

@ -79,5 +79,45 @@ namespace NzbDrone.Core.Test.MediaFiles.MovieImport.Aggregation.Aggregators
localMovie.ReleaseGroup.Should().Be("Wizzy");
}
[Test]
public void should_not_use_imdbId()
{
var fileMovieInfo = Parser.Parser.ParseMovieTitle("Lock Stock and Two Smoking Barrels (1998) [imdb-tt0120735][Bluray-1080p][8bit][x264][DTS-HD MA 5.1]-FraMeSToR", false);
var folderMovieInfo = Parser.Parser.ParseMovieTitle("Lock Stock and Two Smoking Barrels (1998) {imdb-tt0120735}", false);
var downloadClientMovieInfo = Parser.Parser.ParseMovieTitle("Movie.Title.2008.WEB-DL", false);
var localMovie = new LocalMovie
{
FileMovieInfo = fileMovieInfo,
FolderMovieInfo = folderMovieInfo,
DownloadClientMovieInfo = downloadClientMovieInfo,
Path = @"C:\Test\Unsorted Movies\Movie.Title.2008\Movie.Title.2008.mkv".AsOsAgnostic(),
Movie = _movie
};
Subject.Aggregate(localMovie, null, false);
localMovie.ReleaseGroup.Should().Be("FraMeSToR");
}
[Test]
public void should_not_use_tmdbbId()
{
var fileMovieInfo = Parser.Parser.ParseMovieTitle("Lock Stock and Two Smoking Barrels (1998) [tmdb-100][Bluray-1080p][8bit][x264][DTS-HD MA 5.1]-FraMeSToR", false);
var folderMovieInfo = Parser.Parser.ParseMovieTitle("Lock Stock and Two Smoking Barrels (1998) {tmdb-100}", false);
var downloadClientMovieInfo = Parser.Parser.ParseMovieTitle("Movie.Title.2008.WEB-DL", false);
var localMovie = new LocalMovie
{
FileMovieInfo = fileMovieInfo,
FolderMovieInfo = folderMovieInfo,
DownloadClientMovieInfo = downloadClientMovieInfo,
Path = @"C:\Test\Unsorted Movies\Movie.Title.2008\Movie.Title.2008.mkv".AsOsAgnostic(),
Movie = _movie
};
Subject.Aggregate(localMovie, null, false);
localMovie.ReleaseGroup.Should().Be("FraMeSToR");
}
}
}

@ -116,7 +116,7 @@ namespace NzbDrone.Core.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|720p|1080p|2160p)))(?<!(?:WEB-DL|Blu-Ray|480p|720p|1080p|2160p|DTS-HD|DTS-X|DTS-MA|DTS-ES|[ ._]\d{4}-\d{2}|-\d{2})(?:\k<part2>)?)(?:\b|[-._ ]|$)|[-._ ]\[(?<releasegroup>[a-z0-9]+)\]$",
private static readonly Regex ReleaseGroupRegex = new Regex(@"-(?<releasegroup>[a-z0-9]+(?<part2>-[a-z0-9]+)?(?!.+?(?:480p|720p|1080p|2160p)))(?<!(?:WEB-DL|Blu-Ray|480p|720p|1080p|2160p|DTS-HD|DTS-X|DTS-MA|DTS-ES|[ ._]\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 AnimeReleaseGroupRegex = new Regex(@"^(?:\[(?<subgroup>(?!\s).+?(?<!\s))\](?:_|-|\s|\.)?)",

Loading…
Cancel
Save