Added new qualities, added new qualities to profile class.


			
			
			
		
Devin Buhl 8 years ago
parent 5ebd035b1c
commit c60be3a467

@ -196,18 +196,18 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsSatisfiedBy(parseResultSingle, null).Accepted.Should().BeTrue(); Subject.IsSatisfiedBy(parseResultSingle, null).Accepted.Should().BeTrue();
} }
[Test] //[Test]
public void should_return_true_if_RAWHD() //public void should_return_true_if_RAWHD()
{ //{
parseResultSingle.ParsedEpisodeInfo.Quality = new QualityModel(Quality.RAWHD); // parseResultSingle.ParsedEpisodeInfo.Quality = new QualityModel(Quality.RAWHD);
series.Runtime = 45; // series.Runtime = 45;
parseResultSingle.Series = series; // parseResultSingle.Series = series;
parseResultSingle.Series.SeriesType = SeriesTypes.Daily; // parseResultSingle.Series.SeriesType = SeriesTypes.Daily;
parseResultSingle.Release.Size = 8000.Megabytes(); // parseResultSingle.Release.Size = 8000.Megabytes();
Subject.IsSatisfiedBy(parseResultSingle, null).Accepted.Should().BeTrue(); // Subject.IsSatisfiedBy(parseResultSingle, null).Accepted.Should().BeTrue();
} //}
[Test] [Test]
public void should_return_true_for_special() public void should_return_true_for_special()

@ -215,19 +215,19 @@ namespace NzbDrone.Core.Test.ParserTests
ParseAndVerifyQuality(title, Quality.Bluray1080p, proper); ParseAndVerifyQuality(title, Quality.Bluray1080p, proper);
} }
[TestCase("POI S02E11 1080i HDTV DD5.1 MPEG2-TrollHD", 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("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)] //[TestCase("The Voice S01E11 The Finals 1080i HDTV DD5.1 MPEG2-TrollHD", false)]
[TestCase("Californication.S07E11.1080i.HDTV.DD5.1.MPEG2-NTb.ts", false)] //[TestCase("Californication.S07E11.1080i.HDTV.DD5.1.MPEG2-NTb.ts", false)]
[TestCase("Game of Thrones S04E10 1080i HDTV MPEG2 DD5.1-CtrlHD.ts", false)] //[TestCase("Game of Thrones S04E10 1080i HDTV MPEG2 DD5.1-CtrlHD.ts", false)]
[TestCase("VICE.S02E05.1080i.HDTV.DD2.0.MPEG2-NTb.ts", false)] //[TestCase("VICE.S02E05.1080i.HDTV.DD2.0.MPEG2-NTb.ts", false)]
[TestCase("Show - S03E01 - Episode Title Raw-HD.ts", false)] //[TestCase("Show - S03E01 - Episode Title Raw-HD.ts", false)]
[TestCase("Saturday.Night.Live.Vintage.S10E09.Eddie.Murphy.The.Honeydrippers.1080i.UPSCALE.HDTV.DD5.1.MPEG2-zebra", false)] //[TestCase("Saturday.Night.Live.Vintage.S10E09.Eddie.Murphy.The.Honeydrippers.1080i.UPSCALE.HDTV.DD5.1.MPEG2-zebra", false)]
[TestCase("The.Colbert.Report.2011-08-04.1080i.HDTV.MPEG-2-CtrlHD", false)] //[TestCase("The.Colbert.Report.2011-08-04.1080i.HDTV.MPEG-2-CtrlHD", false)]
public void should_parse_raw_quality(string title, bool proper) //public void should_parse_raw_quality(string title, bool proper)
{ //{
ParseAndVerifyQuality(title, Quality.RAWHD, proper); // ParseAndVerifyQuality(title, Quality.RAWHD, proper);
} //}
[TestCase("Sonny.With.a.Chance.S02E15", false)] [TestCase("Sonny.With.a.Chance.S02E15", false)]
[TestCase("Law & Order: Special Victims Unit - 11x11 - Quickie", false)] [TestCase("Law & Order: Special Victims Unit - 11x11 - Quickie", false)]

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.Qualities
new object[] {7, Quality.Bluray1080p}, new object[] {7, Quality.Bluray1080p},
new object[] {8, Quality.WEBDL480p}, new object[] {8, Quality.WEBDL480p},
new object[] {9, Quality.HDTV1080p}, new object[] {9, Quality.HDTV1080p},
new object[] {10, Quality.RAWHD}, //new object[] {10, Quality.RAWHD},
new object[] {16, Quality.HDTV2160p}, new object[] {16, Quality.HDTV2160p},
new object[] {18, Quality.WEBDL2160p}, new object[] {18, Quality.WEBDL2160p},
new object[] {19, Quality.Bluray2160p}, new object[] {19, Quality.Bluray2160p},
@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test.Qualities
new object[] {Quality.Bluray1080p, 7}, new object[] {Quality.Bluray1080p, 7},
new object[] {Quality.WEBDL480p, 8}, new object[] {Quality.WEBDL480p, 8},
new object[] {Quality.HDTV1080p, 9}, new object[] {Quality.HDTV1080p, 9},
new object[] {Quality.RAWHD, 10}, //new object[] {Quality.RAWHD, 10},
new object[] {Quality.HDTV2160p, 16}, new object[] {Quality.HDTV2160p, 16},
new object[] {Quality.WEBDL2160p, 18}, new object[] {Quality.WEBDL2160p, 18},
new object[] {Quality.Bluray2160p, 19}, new object[] {Quality.Bluray2160p, 19},
@ -65,20 +65,26 @@ namespace NzbDrone.Core.Test.Qualities
{ {
var qualities = new List<Quality> var qualities = new List<Quality>
{ {
Quality.Unknown, Quality.CAM,
Quality.TELECINE,
Quality.DVDSCR,
Quality.R5,
Quality.SDTV, Quality.SDTV,
Quality.WEBDL480p,
Quality.DVD, Quality.DVD,
Quality.DVDR,
Quality.HDTV720p, Quality.HDTV720p,
Quality.HDTV1080p, Quality.HDTV1080p,
Quality.HDTV2160p, Quality.HDTV2160p,
Quality.RAWHD, Quality.WEBDL480p,
Quality.WEBDL720p, Quality.WEBDL720p,
Quality.WEBDL1080p, Quality.WEBDL1080p,
Quality.WEBDL2160p, Quality.WEBDL2160p,
Quality.Bluray480p,
Quality.Bluray576p,
Quality.Bluray720p, Quality.Bluray720p,
Quality.Bluray1080p, Quality.Bluray1080p,
Quality.Bluray2160p, Quality.Bluray2160p,
Quality.BRDISK
}; };
if (allowed.Length == 0) if (allowed.Length == 0)

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
{ {
new ProfileQualityItem { Allowed = true, Quality = Quality.SDTV }, new ProfileQualityItem { Allowed = true, Quality = Quality.SDTV },
new ProfileQualityItem { Allowed = true, Quality = Quality.WEBDL480p }, new ProfileQualityItem { Allowed = true, Quality = Quality.WEBDL480p },
new ProfileQualityItem { Allowed = true, Quality = Quality.RAWHD } //new ProfileQualityItem { Allowed = true, Quality = Quality.RAWHD }
} }
}; };
@ -71,13 +71,13 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
var qualityMet = new EpisodeFile { RelativePath = "a", Quality = new QualityModel { Quality = Quality.WEBDL480p } }; var qualityMet = new EpisodeFile { RelativePath = "a", Quality = new QualityModel { Quality = Quality.WEBDL480p } };
var qualityUnmet = new EpisodeFile { RelativePath = "b", Quality = new QualityModel { Quality = Quality.SDTV } }; var qualityUnmet = new EpisodeFile { RelativePath = "b", Quality = new QualityModel { Quality = Quality.SDTV } };
var qualityRawHD = new EpisodeFile { RelativePath = "c", Quality = new QualityModel { Quality = Quality.RAWHD } }; //var qualityRawHD = new EpisodeFile { RelativePath = "c", Quality = new QualityModel { Quality = Quality.RAWHD } };
MediaFileRepository fileRepository = Mocker.Resolve<MediaFileRepository>(); MediaFileRepository fileRepository = Mocker.Resolve<MediaFileRepository>();
qualityMet = fileRepository.Insert(qualityMet); qualityMet = fileRepository.Insert(qualityMet);
qualityUnmet = fileRepository.Insert(qualityUnmet); qualityUnmet = fileRepository.Insert(qualityUnmet);
qualityRawHD = fileRepository.Insert(qualityRawHD); //qualityRawHD = fileRepository.Insert(qualityRawHD);
var monitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(4) var monitoredSeriesEpisodes = Builder<Episode>.CreateListOfSize(4)
.All() .All()
@ -90,8 +90,8 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
.With(e => e.Monitored = false) .With(e => e.Monitored = false)
.With(e => e.EpisodeFileId = qualityMet.Id) .With(e => e.EpisodeFileId = qualityMet.Id)
.TheNext(1) .TheNext(1)
.With(e => e.EpisodeFileId = qualityRawHD.Id) //.With(e => e.EpisodeFileId = qualityRawHD.Id)
.TheLast(1) //.TheLast(1)
.With(e => e.SeasonNumber = 0) .With(e => e.SeasonNumber = 0)
.Build(); .Build();

@ -44,6 +44,9 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
[FieldDefinition(4, Type = FieldType.Checkbox, Label = "Require Approved", HelpText = "Require staff-approval for releases to be accepted.")] [FieldDefinition(4, Type = FieldType.Checkbox, Label = "Require Approved", HelpText = "Require staff-approval for releases to be accepted.")]
public bool Approved { get; set; } public bool Approved { get; set; }
[FieldDefinition(5, Type = FieldType.Checkbox, Label = "Require Golden", HelpText = "Require Golden Popcorn-releases for releases to be accepted.")]
public bool RequireGolden { get; set; }
public NzbDroneValidationResult Validate() public NzbDroneValidationResult Validate()
{ {
return new NzbDroneValidationResult(Validator.Validate(this)); return new NzbDroneValidationResult(Validator.Validate(this));

@ -75,11 +75,11 @@ namespace NzbDrone.Core.Parser
} }
} }
if (RawHDRegex.IsMatch(normalizedName)) //if (RawHDRegex.IsMatch(normalizedName))
{ //{
result.Quality = Quality.RAWHD; // result.Quality = Quality.RAWHD;
return result; // return result;
} //}
var sourceMatch = SourceRegex.Matches(normalizedName).OfType<Match>().LastOrDefault(); var sourceMatch = SourceRegex.Matches(normalizedName).OfType<Match>().LastOrDefault();
var resolution = ParseResolution(normalizedName); var resolution = ParseResolution(normalizedName);

@ -85,38 +85,53 @@ namespace NzbDrone.Core.Profiles
_logger.Info("Setting up default quality profiles"); _logger.Info("Setting up default quality profiles");
AddDefaultProfile("Any", Quality.SDTV, AddDefaultProfile("Any", Quality.DVD,
Quality.CAM,
Quality.TELECINE,
Quality.DVDSCR,
Quality.R5,
Quality.SDTV, Quality.SDTV,
Quality.WEBDL480p,
Quality.DVD, Quality.DVD,
Quality.DVDR,
Quality.HDTV720p, Quality.HDTV720p,
Quality.HDTV1080p, Quality.HDTV1080p,
Quality.HDTV2160p,
Quality.WEBDL480p,
Quality.WEBDL720p, Quality.WEBDL720p,
Quality.WEBDL1080p, Quality.WEBDL1080p,
Quality.WEBDL2160p,
Quality.Bluray480p,
Quality.Bluray576p,
Quality.Bluray720p, Quality.Bluray720p,
Quality.Bluray1080p); Quality.Bluray1080p,
Quality.Bluray2160p,
AddDefaultProfile("SD", Quality.SDTV, Quality.BRDISK);
AddDefaultProfile("SD", Quality.DVD,
Quality.CAM,
Quality.TELECINE,
Quality.DVDSCR,
Quality.R5,
Quality.SDTV, Quality.SDTV,
Quality.WEBDL480p, Quality.DVD,
Quality.DVD); Quality.WEBDL480p);
AddDefaultProfile("HD-720p", Quality.HDTV720p, AddDefaultProfile("HD-720p", Quality.Bluray720p,
Quality.HDTV720p, Quality.HDTV720p,
Quality.WEBDL720p, Quality.WEBDL720p,
Quality.Bluray720p); Quality.Bluray720p);
AddDefaultProfile("HD-1080p", Quality.HDTV1080p, AddDefaultProfile("HD-1080p", Quality.Bluray1080p,
Quality.HDTV1080p, Quality.HDTV1080p,
Quality.WEBDL1080p, Quality.WEBDL1080p,
Quality.Bluray1080p); Quality.Bluray1080p);
AddDefaultProfile("Ultra-HD", Quality.HDTV2160p, AddDefaultProfile("Ultra-HD", Quality.Bluray2160p,
Quality.HDTV2160p, Quality.HDTV2160p,
Quality.WEBDL2160p, Quality.WEBDL2160p,
Quality.Bluray2160p); Quality.Bluray2160p);
AddDefaultProfile("HD - 720p/1080p", Quality.HDTV720p, AddDefaultProfile("HD - 720p/1080p", Quality.Bluray720p,
Quality.HDTV720p, Quality.HDTV720p,
Quality.HDTV1080p, Quality.HDTV1080p,
Quality.WEBDL720p, Quality.WEBDL720p,

@ -55,45 +55,67 @@ namespace NzbDrone.Core.Qualities
return !Equals(left, right); return !Equals(left, right);
} }
public static Quality Unknown => new Quality(0, "Unknown"); // Unable to determine
public static Quality SDTV => new Quality(1, "SDTV"); public static Quality Unknown => new Quality(0, "Unknown");
public static Quality DVD => new Quality(2, "DVD");
public static Quality WEBDL1080p => new Quality(3, "WEBDL-1080p"); // Pre-release
public static Quality HDTV720p => new Quality(4, "HDTV-720p"); public static Quality CAM => new Quality(24, "CAM"); // new
public static Quality WEBDL720p => new Quality(5, "WEBDL-720p"); public static Quality TELECINE => new Quality(25, "TELECINE"); // new
public static Quality Bluray720p => new Quality(6, "Bluray-720p"); public static Quality DVDSCR => new Quality(26, "DVDSCR"); // new
public static Quality Bluray1080p => new Quality(7, "Bluray-1080p"); public static Quality R5 => new Quality(27, "R5"); // new
public static Quality WEBDL480p => new Quality(8, "WEBDL-480p");
public static Quality HDTV1080p => new Quality(9, "HDTV-1080p"); // SD
public static Quality RAWHD => new Quality(10, "Raw-HD"); public static Quality SDTV => new Quality(1, "SDTV");
//public static Quality HDTV480p { get { return new Quality(11, "HDTV-480p"); } } public static Quality DVD => new Quality(2, "DVD");
//public static Quality WEBRip480p { get { return new Quality(12, "WEBRip-480p"); } } public static Quality DVDR => new Quality(23, "DVD-R"); // new
//public static Quality Bluray480p { get { return new Quality(13, "Bluray-480p"); } }
//public static Quality WEBRip720p { get { return new Quality(14, "WEBRip-720p"); } } // HDTV
//public static Quality WEBRip1080p { get { return new Quality(15, "WEBRip-1080p"); } } public static Quality HDTV720p => new Quality(4, "HDTV-720p");
public static Quality HDTV1080p => new Quality(9, "HDTV-1080p");
public static Quality HDTV2160p => new Quality(16, "HDTV-2160p"); public static Quality HDTV2160p => new Quality(16, "HDTV-2160p");
//public static Quality WEBRip2160p { get { return new Quality(17, "WEBRip-2160p"); } }
// Web-DL
public static Quality WEBDL480p => new Quality(8, "WEBDL-480p");
public static Quality WEBDL720p => new Quality(5, "WEBDL-720p");
public static Quality WEBDL1080p => new Quality(3, "WEBDL-1080p");
public static Quality WEBDL2160p => new Quality(18, "WEBDL-2160p"); public static Quality WEBDL2160p => new Quality(18, "WEBDL-2160p");
// Bluray
public static Quality Bluray480p => new Quality(20, "Bluray-480p"); // new
public static Quality Bluray576p => new Quality(21, "Bluray-576p"); // new
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 Bluray2160p => new Quality(19, "Bluray-2160p");
public static Quality BRDISK => new Quality(22, "BR-DISK"); // new
// Others
// public static Quality RAWHD => new Quality(10, "Raw-HD");
static Quality() static Quality()
{ {
All = new List<Quality> All = new List<Quality>
{ {
Unknown, Unknown,
CAM,
TELECINE,
DVDSCR,
R5,
SDTV, SDTV,
DVD, DVD,
WEBDL1080p, DVDR,
HDTV720p, HDTV720p,
WEBDL720p,
Bluray720p,
Bluray1080p,
WEBDL480p,
HDTV1080p, HDTV1080p,
RAWHD,
HDTV2160p, HDTV2160p,
WEBDL480p,
WEBDL720p,
WEBDL1080p,
WEBDL2160p, WEBDL2160p,
Bluray480p,
Bluray576p,
Bluray720p,
Bluray1080p,
Bluray2160p, Bluray2160p,
BRDISK
}; };
AllLookup = new Quality[All.Select(v => v.Id).Max() + 1]; AllLookup = new Quality[All.Select(v => v.Id).Max() + 1];
@ -105,19 +127,30 @@ namespace NzbDrone.Core.Qualities
DefaultQualityDefinitions = new HashSet<QualityDefinition> DefaultQualityDefinitions = new HashSet<QualityDefinition>
{ {
new QualityDefinition(Quality.Unknown) { Weight = 1, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.Unknown) { Weight = 1, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.SDTV) { Weight = 2, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.CAM) { Weight = 2, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL480p) { Weight = 3, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.TELECINE) { Weight = 3, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.DVD) { Weight = 4, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.R5) { Weight = 4, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV720p) { Weight = 5, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.DVDSCR) { Weight = 5, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV1080p) { Weight = 6, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.SDTV) { Weight = 6, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.RAWHD) { Weight = 7, MinSize = 0, MaxSize = null }, new QualityDefinition(Quality.DVD) { Weight = 7, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL720p) { Weight = 8, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.DVDR) { Weight = 8, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray720p) { Weight = 9, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 10, MinSize = 0, MaxSize = 100 }, new QualityDefinition(Quality.HDTV720p) { Weight = 9, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 11, MinSize = 0, MaxSize = null }, new QualityDefinition(Quality.HDTV1080p) { Weight = 10, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.HDTV2160p) { Weight = 12, MinSize = 0, MaxSize = null }, new QualityDefinition(Quality.HDTV2160p) { Weight = 11, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 13, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 14, MinSize = 0, MaxSize = null }, new QualityDefinition(Quality.WEBDL480p) { Weight = 12, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL720p) { Weight = 13, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL1080p) { Weight = 14, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.WEBDL2160p) { Weight = 15, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray480p) { Weight = 16, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray576p) { Weight = 17, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray720p) { Weight = 18, MinSize = 0, MaxSize = 100 },
new QualityDefinition(Quality.Bluray1080p) { Weight = 19, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.Bluray2160p) { Weight = 20, MinSize = 0, MaxSize = null },
new QualityDefinition(Quality.BRDISK) { Weight = 21, MinSize = 0, MaxSize = null }
}; };
} }

Loading…
Cancel
Save