mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fixed: Don't Parse TMDb id and IMDb id as group
This commit is contained in:
parent
566c1405c2
commit
012fe53acc
@ -79,5 +79,45 @@ public void should_fallback_to_file()
|
||||
|
||||
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 @@ 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|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…
Reference in New Issue
Block a user