From c91852018e04992bbe0892620f43cd60758e110e Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 23 May 2011 10:20:43 -0700 Subject: [PATCH] simplified some quality types --- NzbDrone.Core.Test/EpisodeProviderTest.cs | Bin 5812 -> 5794 bytes NzbDrone.Core.Test/HistoryProviderTest.cs | 8 +++---- NzbDrone.Core.Test/MediaFileProviderTests.cs | 2 +- NzbDrone.Core.Test/ParserTest.cs | 22 +++++++++--------- NzbDrone.Core.Test/QualityProfileTest.cs | 4 ++-- NzbDrone.Core.Test/SeriesProviderTest.cs | Bin 7765 -> 7705 bytes NzbDrone.Core/CentralDispatch.cs | 6 ++--- NzbDrone.Core/Parser.cs | 15 +++++------- .../Repository/Quality/QualityTypes.cs | 12 ++++++---- 9 files changed, 34 insertions(+), 35 deletions(-) diff --git a/NzbDrone.Core.Test/EpisodeProviderTest.cs b/NzbDrone.Core.Test/EpisodeProviderTest.cs index 4ddd504c12a12b399f76809883c1a4acefe9985d..ca1f04183d2ad398154b3328c0203f5d4445bd98 100644 GIT binary patch delta 24 gcmdm@yGVCKGzU|#%jRf~Z)}r4aB^(U<#%TX0CA-VfB*mh delta 26 icmZ3ayG3_HG{@#xj&E!%Ewu4X9oa?CkaRZ diff --git a/NzbDrone.Core.Test/HistoryProviderTest.cs b/NzbDrone.Core.Test/HistoryProviderTest.cs index c689a41ff..8bb535d9d 100644 --- a/NzbDrone.Core.Test/HistoryProviderTest.cs +++ b/NzbDrone.Core.Test/HistoryProviderTest.cs @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test HistoryId = new int(), Date = DateTime.Now, IsProper = false, - Quality = QualityTypes.TV, + Quality = QualityTypes.SDTV, EpisodeId = episode.EpisodeId } }; @@ -123,7 +123,7 @@ namespace NzbDrone.Core.Test var target = new HistoryProvider(repo.Object); //Act - var result = target.Exists(episode.EpisodeId, QualityTypes.TV, false); + var result = target.Exists(episode.EpisodeId, QualityTypes.SDTV, false); //Assert Assert.AreEqual(result, true); @@ -156,7 +156,7 @@ namespace NzbDrone.Core.Test HistoryId = new int(), Date = DateTime.Now, IsProper = false, - Quality = QualityTypes.TV, + Quality = QualityTypes.SDTV, EpisodeId = episode.EpisodeId } }; @@ -168,7 +168,7 @@ namespace NzbDrone.Core.Test var target = new HistoryProvider(repo.Object); //Act - var result = target.Exists(episode.EpisodeId, QualityTypes.TV, true); + var result = target.Exists(episode.EpisodeId, QualityTypes.SDTV, true); //Assert Assert.AreEqual(result, false); diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index fd9a1b87e..75ef69a47 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test mocker.VerifyAllMocks(); Assert.AreEqual(fakeEpisode.SeriesId, result.SeriesId); - Assert.AreEqual(QualityTypes.BDRip, result.Quality); + Assert.AreEqual(QualityTypes.DVD, result.Quality); Assert.AreEqual(Parser.NormalizePath(fileName), result.Path); Assert.AreEqual(size, result.Size); Assert.AreEqual(false, result.Proper); diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 4650a0db7..f113a5584 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -67,28 +67,28 @@ namespace NzbDrone.Core.Test [Test] - [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.BDRip)] - [Row("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.BDRip)] + [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)] + [Row("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)] [Row("Two.and.a.Half.Men.S08E05.720p.HDTV.X264-DIMENSION", QualityTypes.HDTV)] - [Row("this has no extention or periods HDTV", QualityTypes.TV)] - [Row("Chuck.S04E05.HDTV.XviD-LOL", QualityTypes.TV)] + [Row("this has no extention or periods HDTV", QualityTypes.SDTV)] + [Row("Chuck.S04E05.HDTV.XviD-LOL", QualityTypes.SDTV)] [Row("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", QualityTypes.DVD)] - [Row("The.Girls.Next.Door.S03E06.HDTV-WiDE", QualityTypes.TV)] - [Row("Degrassi.S10E27.WS.DSR.XviD-2HD", QualityTypes.TV)] + [Row("The.Girls.Next.Door.S03E06.HDTV-WiDE", QualityTypes.SDTV)] + [Row("Degrassi.S10E27.WS.DSR.XviD-2HD", QualityTypes.SDTV)] [Row("Sonny.With.a.Chance.S02E15.720p.WEB-DL.DD5.1.H.264-SURFER", QualityTypes.WEBDL)] [Row("Sonny.With.a.Chance.S02E15.720p", QualityTypes.HDTV)] [Row("Sonny.With.a.Chance.S02E15.mkv", QualityTypes.HDTV)] - [Row("Sonny.With.a.Chance.S02E15.avi", QualityTypes.TV)] - [Row("Sonny.With.a.Chance.S02E15.xvid", QualityTypes.TV)] - [Row("Sonny.With.a.Chance.S02E15.divx", QualityTypes.TV)] + [Row("Sonny.With.a.Chance.S02E15.avi", QualityTypes.SDTV)] + [Row("Sonny.With.a.Chance.S02E15.xvid", QualityTypes.SDTV)] + [Row("Sonny.With.a.Chance.S02E15.divx", QualityTypes.SDTV)] [Row("Sonny.With.a.Chance.S02E15", QualityTypes.Unknown)] [Row("Chuck - S01E04 - So Old - Playdate - 720p TV.mkv", QualityTypes.HDTV)] [Row("Chuck - S22E03 - MoneyBART - HD TV.mkv", QualityTypes.HDTV)] [Row("Chuck - S01E03 - Come Fly With Me - 720p BluRay.mkv", QualityTypes.Bluray720)] [Row("Chuck - S01E03 - Come Fly With Me - 1080p BluRay.mkv", QualityTypes.Bluray1080)] [Row("Chuck - S11E06 - D-Yikes! - 720p WEB-DL.mkv", QualityTypes.WEBDL)] - [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", QualityTypes.BDRip)] - [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", QualityTypes.BDRip)] + [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", QualityTypes.DVD)] + [Row("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", QualityTypes.DVD)] [Row("Law & Order: Special Victims Unit - 11x11 - Quickie", QualityTypes.Unknown)] [Row("(NZB)", QualityTypes.Unknown)] public void quality_parse(string postTitle, object quality) diff --git a/NzbDrone.Core.Test/QualityProfileTest.cs b/NzbDrone.Core.Test/QualityProfileTest.cs index da1faeba3..5f3b46290 100644 --- a/NzbDrone.Core.Test/QualityProfileTest.cs +++ b/NzbDrone.Core.Test/QualityProfileTest.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test var testProfile = new QualityProfile { Name = Guid.NewGuid().ToString(), - Cutoff = QualityTypes.TV, + Cutoff = QualityTypes.SDTV, Allowed = new List { QualityTypes.HDTV, QualityTypes.DVD }, }; @@ -49,7 +49,7 @@ namespace NzbDrone.Core.Test var testProfile = new QualityProfile { Name = Guid.NewGuid().ToString(), - Cutoff = QualityTypes.TV, + Cutoff = QualityTypes.SDTV, Allowed = new List { QualityTypes.HDTV, QualityTypes.DVD }, }; diff --git a/NzbDrone.Core.Test/SeriesProviderTest.cs b/NzbDrone.Core.Test/SeriesProviderTest.cs index ef891cbce1856dd701d911a4bef05268b6ee4294..7177474f06a93a9fb8e47cfc11a49f4b3af1af5d 100644 GIT binary patch delta 108 zcmca=Gt*{+s;EX_X<|-hNo7c7L29vHuuDjojzURMX{u%{FP8!oLps;Hi!k&Z%OX<|-hNo7c7L29vHNSKa7Nl|I4W-Kq40u)3C<(F%KR8IC4 z)nNfMDn<1nj1{7K5XLo8O$g(^s6Ah1UWr0+YEfotv1bZUo1NHUEhm?t%mOsaT*6$? bL_)$8YA0_LQ`l@Neus$zX2fQ3DJB*Gp)of5 diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index fb5513448..8c60db6ff 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -197,15 +197,15 @@ namespace NzbDrone.Core var sd = new QualityProfile { Name = "SD", - Allowed = new List { QualityTypes.TV, QualityTypes.DVD }, - Cutoff = QualityTypes.TV + Allowed = new List { QualityTypes.SDTV, QualityTypes.DVD }, + Cutoff = QualityTypes.SDTV }; var hd = new QualityProfile { Name = "HD", Allowed = - new List { QualityTypes.HDTV, QualityTypes.WEBDL, QualityTypes.BDRip, QualityTypes.Bluray720 }, + new List { QualityTypes.HDTV, QualityTypes.WEBDL, QualityTypes.Bluray720 }, Cutoff = QualityTypes.HDTV }; diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index ded4abe8f..d6a24267b 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -205,22 +205,19 @@ namespace NzbDrone.Core var result = QualityTypes.Unknown; name = name.ToLowerInvariant(); - if (name.Contains("dvd")) - return QualityTypes.DVD; - - if (name.Contains("bdrip") || name.Contains("brrip")) + if (name.Contains("dvd") || name.Contains("bdrip") || name.Contains("brrip")) { - return QualityTypes.BDRip; + return QualityTypes.DVD; } if (name.Contains("xvid") || name.Contains("divx")) { if (name.Contains("bluray")) { - return QualityTypes.BDRip; + return QualityTypes.DVD; } - return QualityTypes.TV; + return QualityTypes.SDTV; } if (name.Contains("bluray")) @@ -253,7 +250,7 @@ namespace NzbDrone.Core case ".wmv": case ".mp4": { - result = QualityTypes.TV; + result = QualityTypes.SDTV; break; } case ".mkv": @@ -271,7 +268,7 @@ namespace NzbDrone.Core } if (name.Contains("hdtv")) { - return QualityTypes.TV; + return QualityTypes.SDTV; } Logger.Trace("Quality Parsed:{0} Title:", result, name); diff --git a/NzbDrone.Core/Repository/Quality/QualityTypes.cs b/NzbDrone.Core/Repository/Quality/QualityTypes.cs index 39c4db84d..2d2571365 100644 --- a/NzbDrone.Core/Repository/Quality/QualityTypes.cs +++ b/NzbDrone.Core/Repository/Quality/QualityTypes.cs @@ -10,30 +10,32 @@ namespace NzbDrone.Core.Repository.Quality /// Quality is unknown /// Unknown = 0, + /// /// SD File (Source could be HD) /// - TV = 1, + SDTV = 1, + /// /// SD File (DVD Source) /// DVD = 2, - /// - /// SD File (HD Source) - /// - BDRip = 3, + /// /// HD File (HDTV Source) /// HDTV = 4, + /// /// HD File (Online Source) /// WEBDL = 5, + /// /// HD File (720p Blu-ray Source) /// Bluray720 = 6, + /// /// HD File (1080p Blu-ray Source) ///