Add remux 1080p and 2160p as qualities (#900)

* Add Remux 1080p and 2160p as qualities, includes Tests & migration

* Whoops forgot to take this out
pull/901/head
Devin Buhl 8 years ago committed by GitHub
parent e33265b58d
commit 28d27dca5c

@ -24,6 +24,8 @@ namespace NzbDrone.Core.Test.ParserTests
new object[] { Quality.Bluray720p },
new object[] { Quality.Bluray1080p },
new object[] { Quality.Bluray2160p },
new object[] { Quality.Remux1080p },
new object[] { Quality.Remux2160p },
};
public static object[] OtherSourceQualityParserCases =
@ -40,6 +42,8 @@ namespace NzbDrone.Core.Test.ParserTests
new object[] { "720p BluRay", Quality.Bluray720p },
new object[] { "1080p BluRay", Quality.Bluray1080p },
new object[] { "2160p BluRay", Quality.Bluray2160p },
new object[] { "1080p Remux", Quality.Remux1080p },
new object[] { "2160p Remux", Quality.Remux2160p },
};
[TestCase("S07E23 .avi ", false)]
@ -221,6 +225,20 @@ namespace NzbDrone.Core.Test.ParserTests
ParseAndVerifyQuality(title, Quality.Bluray576p, false);
}
[TestCase("Contract.to.Kill.2016.REMUX.1080p.BluRay.AVC.DTS-HD.MA.5.1-iFT")]
[TestCase("27.Dresses.2008.REMUX.1080p.Bluray.AVC.DTS-HR.MA.5.1-LEGi0N")]
public void should_parse_remux1080p_quality(string title)
{
ParseAndVerifyQuality(title, Quality.Remux1080p, false);
}
[TestCase("Contract.to.Kill.2016.REMUX.2160p.BluRay.AVC.DTS-HD.MA.5.1-iFT")]
[TestCase("27.Dresses.2008.REMUX.2160p.Bluray.AVC.DTS-HR.MA.5.1-LEGi0N")]
public void should_parse_remux2160p_quality(string title)
{
ParseAndVerifyQuality(title, Quality.Remux2160p, false);
}
//[TestCase("POI S02E11 1080i HDTV DD5.1 MPEG2-TrollHD", false)]
//[TestCase("How I Met Your Mother S01E18 Nothing Good Happens After 2 A.M. 720p HDTV DD5.1 MPEG2-TrollHD", false)]
//[TestCase("The Voice S01E11 The Finals 1080i HDTV DD5.1 MPEG2-TrollHD", false)]

@ -0,0 +1,24 @@
using System.Data;
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(134)]
public class add_remux_qualities_for_the_wankers : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.WithConnection(ConvertProfile);
}
private void ConvertProfile(IDbConnection conn, IDbTransaction tran)
{
var updater = new ProfileUpdater70(conn, tran);
updater.SplitQualityAppend(19, 31); // Remux2160p AFTER Bluray2160p
updater.SplitQualityAppend(7, 30); // Remux1080p AFTER Bluray1080p
updater.Commit();
}
}
}

@ -124,6 +124,7 @@
<Compile Include="Authentication\UserRepository.cs" />
<Compile Include="Authentication\UserService.cs" />
<Compile Include="Datastore\Migration\123_create_netimport_table.cs" />
<Compile Include="Datastore\Migration\134_add_remux_qualities_for_the_wankers.cs" />
<Compile Include="Datastore\Migration\129_add_parsed_movie_info_to_pending_release.cs" />
<Compile Include="Datastore\Migration\128_remove_kickass.cs" />
<Compile Include="Datastore\Migration\130_remove_wombles_kickass.cs" />

@ -50,7 +50,7 @@ namespace NzbDrone.Core.Parser
private static readonly Regex HardcodedSubsRegex = new Regex(@"\b(?<hcsub>(\w+SUBS?)\b)|(?<hc>(HC))\b", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
private static readonly Regex RawHDRegex = new Regex(@"\b(?<rawhd>RawHD|1080i[-_. ]HDTV|Raw[-_. ]HD|MPEG[-_. ]?2)\b",
private static readonly Regex RemuxRegex = new Regex(@"\b(?<remux>Remux)\b",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex ProperRegex = new Regex(@"\b(?<proper>proper|repack|rerip)\b",
@ -95,16 +95,24 @@ namespace NzbDrone.Core.Parser
}
}
//if (RawHDRegex.IsMatch(normalizedName))
//{
// result.Quality = Quality.RAWHD;
// return result;
//}
var sourceMatch = SourceRegex.Matches(normalizedName).OfType<Match>().LastOrDefault();
var resolution = ParseResolution(normalizedName);
var codecRegex = CodecRegex.Match(normalizedName);
if (RemuxRegex.IsMatch(normalizedName))
{
if (resolution == Resolution.R2160p)
{
result.Quality = Quality.Remux2160p;
return result;
}
if (resolution == Resolution.R1080p)
{
result.Quality = Quality.Remux1080p;
return result;
}
}
if (sourceMatch != null && sourceMatch.Success)
{

@ -107,6 +107,8 @@ namespace NzbDrone.Core.Profiles
Quality.Bluray720p,
Quality.Bluray1080p,
Quality.Bluray2160p,
Quality.Remux1080p,
Quality.Remux2160p,
Quality.BRDISK);
AddDefaultProfile("SD", Quality.Bluray480p,
@ -130,12 +132,14 @@ namespace NzbDrone.Core.Profiles
AddDefaultProfile("HD-1080p", Quality.Bluray1080p,
Quality.HDTV1080p,
Quality.WEBDL1080p,
Quality.Bluray1080p);
Quality.Bluray1080p,
Quality.Remux1080p);
AddDefaultProfile("Ultra-HD", Quality.Bluray2160p,
AddDefaultProfile("Ultra-HD", Quality.Remux2160p,
Quality.HDTV2160p,
Quality.WEBDL2160p,
Quality.Bluray2160p);
Quality.Bluray2160p,
Quality.Remux2160p);
AddDefaultProfile("HD - 720p/1080p", Quality.Bluray720p,
Quality.HDTV720p,
@ -143,7 +147,10 @@ namespace NzbDrone.Core.Profiles
Quality.WEBDL720p,
Quality.WEBDL1080p,
Quality.Bluray720p,
Quality.Bluray1080p);
Quality.Bluray1080p,
Quality.Remux1080p,
Quality.Remux2160p
);
}
}
}

@ -88,6 +88,10 @@ namespace NzbDrone.Core.Qualities
public static Quality Bluray720p => new Quality(6, "Bluray-720p");
public static Quality Bluray1080p => new Quality(7, "Bluray-1080p");
public static Quality Bluray2160p => new Quality(19, "Bluray-2160p");
public static Quality Remux1080p => new Quality(30, "Remux-1080p");
public static Quality Remux2160p => new Quality(31, "Remux-2160p");
public static Quality BRDISK => new Quality(22, "BR-DISK"); // new
// Others
@ -119,6 +123,8 @@ namespace NzbDrone.Core.Qualities
Bluray720p,
Bluray1080p,
Bluray2160p,
Remux1080p,
Remux2160p,
BRDISK,
RAWHD
};
@ -153,13 +159,15 @@ namespace NzbDrone.Core.Qualities
new QualityDefinition(Quality.HDTV1080p) { Weight = 17, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 18, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 19, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Remux1080p) { Weight = 20, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.HDTV2160p) { Weight = 20, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 21, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 22, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.HDTV2160p) { Weight = 21, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 22, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 23, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Remux2160p) { Weight = 24, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.BRDISK) { Weight = 23, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.RAWHD) { Weight = 24, MinSize = 0, MaxSize = null }
new QualityDefinition(Quality.BRDISK) { Weight = 25, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.RAWHD) { Weight = 26, MinSize = 0, MaxSize = null }
};
}

Loading…
Cancel
Save