1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

Fixed: Handle obfuscated files using abc.xyz pattern

Fixes #5105

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick
2020-10-04 00:51:59 -04:00
parent a66b2cf416
commit 30c51ec4f3
3 changed files with 203 additions and 0 deletions
@@ -0,0 +1,96 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.ParserTests
{
[TestFixture]
public class HashedReleaseFixture : CoreTest
{
public static object[] HashedReleaseParserCases =
{
new object[]
{
@"C:\Test\Some.Hashed.Release.2018.720p.WEB-DL.AAC2.0.H.264-Mercury\0e895c37245186812cb08aab1529cf8ee389dd05.mkv".AsOsAgnostic(),
"Some Hashed Release",
Quality.WEBDL720p,
"Mercury"
},
new object[]
{
@"C:\Test\0e895c37245186812cb08aab1529cf8ee389dd05\Some.Hashed.Release.2018.720p.WEB-DL.AAC2.0.H.264-Mercury.mkv".AsOsAgnostic(),
"Some Hashed Release",
Quality.WEBDL720p,
"Mercury"
},
new object[]
{
@"C:\Test\Weeds.2018.DVDRip.XviD-RADARR\AHFMZXGHEWD660.mkv".AsOsAgnostic(),
"Weeds",
Quality.DVD,
"RADARR"
},
new object[]
{
@"C:\Test\Deadwood.2018.1080p.BluRay.x264-RADARR\Backup_72023S02-12.mkv".AsOsAgnostic(),
"Deadwood",
Quality.Bluray1080p,
null
},
new object[]
{
@"C:\Test\Grimm 2018 720p WEB-DL DD5 1 H 264-ECI\123.mkv".AsOsAgnostic(),
"Grimm",
Quality.WEBDL720p,
"ECI"
},
new object[]
{
@"C:\Test\Grimm 2018 720p WEB-DL DD5 1 H 264-ECI\abc.mkv".AsOsAgnostic(),
"Grimm",
Quality.WEBDL720p,
"ECI"
},
new object[]
{
@"C:\Test\Grimm 2018 720p WEB-DL DD5 1 H 264-ECI\b00bs.mkv".AsOsAgnostic(),
"Grimm",
Quality.WEBDL720p,
"ECI"
},
new object[]
{
@"C:\Test\The.Good.Wife.2018.720p.HDTV.x264-NZBgeek/cgajsofuejsa501.mkv".AsOsAgnostic(),
"The Good Wife",
Quality.HDTV720p,
"NZBgeek"
},
new object[]
{
@"C:\Test\Fargo.2018.1080p.WEB-DL.DD5.1.H264-RARBG\170424_26.mkv".AsOsAgnostic(),
"Fargo",
Quality.WEBDL1080p,
"RARBG"
},
new object[]
{
@"C:\Test\Movie.Title.2018.720p.HDTV.H.264\abc.xyz.af6021c37f7852.mkv".AsOsAgnostic(),
"Movie Title",
Quality.HDTV720p,
null
}
};
[Test]
[TestCaseSource(nameof(HashedReleaseParserCases))]
public void should_properly_parse_hashed_releases(string path, string title, Quality quality, string releaseGroup)
{
var result = Parser.Parser.ParseMoviePath(path);
result.MovieTitle.Should().Be(title);
result.Quality.Quality.Should().Be(quality);
result.ReleaseGroup.Should().Be(releaseGroup);
}
}
}