1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Handle numerical hashed releases

This commit is contained in:
Mark McDowall 2014-12-15 10:04:55 -08:00
parent d4ccbda99f
commit 98b4027510
2 changed files with 20 additions and 9 deletions

View File

@ -1,5 +1,6 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
@ -14,52 +15,59 @@ public class HashedReleaseFixture : CoreTest
{
@"C:\Test\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury\0e895c37245186812cb08aab1529cf8ee389dd05.mkv".AsOsAgnostic(),
"somehashedrelease",
"WEBDL-720p",
Quality.WEBDL720p,
"Mercury"
},
new object[]
{
@"C:\Test\0e895c37245186812cb08aab1529cf8ee389dd05\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury.mkv".AsOsAgnostic(),
"somehashedrelease",
"WEBDL-720p",
Quality.WEBDL720p,
"Mercury"
},
new object[]
{
@"C:\Test\Fake.Dir.S01E01-Test\yrucreM-462.H.0.2CAA.LD-BEW.p027.10E10S.esaeleR.dehsaH.emoS.mkv".AsOsAgnostic(),
"somehashedrelease",
"WEBDL-720p",
Quality.WEBDL720p,
"Mercury"
},
new object[]
{
@"C:\Test\Fake.Dir.S01E01-Test\yrucreM-LN 1.5DD LD-BEW P0801 10E10S esaeleR dehsaH emoS.mkv".AsOsAgnostic(),
"somehashedrelease",
"WEBDL-1080p",
Quality.WEBDL1080p,
"Mercury"
},
new object[]
{
@"C:\Test\Weeds.S01E10.DVDRip.XviD-NZBgeek\AHFMZXGHEWD660.mkv".AsOsAgnostic(),
"weeds",
"DVD",
Quality.DVD,
"NZBgeek"
},
new object[]
{
@"C:\Test\Deadwood.S02E12.1080p.BluRay.x264-SONARR\Backup_72023S02-12.mkv".AsOsAgnostic(),
"deadwood",
"Bluray-1080p",
Quality.Bluray1080p,
"SONARR"
},
new object[]
{
@"C:\Test\Grimm S04E08 Chupacabra 720p WEB-DL DD5 1 H 264-ECI\123.mkv".AsOsAgnostic(),
"grimm",
Quality.WEBDL720p,
"ECI"
}
};
[Test, TestCaseSource("HashedReleaseParserCases")]
public void should_properly_parse_hashed_releases(string path, string title, string quality, string releaseGroup)
public void should_properly_parse_hashed_releases(string path, string title, Quality quality, string releaseGroup)
{
var result = Parser.Parser.ParsePath(path);
result.SeriesTitle.Should().Be(title);
result.Quality.ToString().Should().Be(quality + " v1");
result.Quality.Quality.Should().Be(quality);
result.ReleaseGroup.Should().Be(releaseGroup);
}
}

View File

@ -132,7 +132,10 @@ public static class Parser
new Regex(@"^[A-Z]{11}\d{3}$", RegexOptions.Compiled),
//Backup filename (Unknown origins)
new Regex(@"^Backup_\d{5,}S\d{2}-\d{2}$", RegexOptions.Compiled)
new Regex(@"^Backup_\d{5,}S\d{2}-\d{2}$", RegexOptions.Compiled),
//123 - Started appearing December 2014
new Regex(@"^123$", RegexOptions.Compiled)
};
//Regex to detect whether the title was reversed.