From 835dc08c7adb93924c901354e2420a589b37d825 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sun, 20 Mar 2016 16:59:00 +0100 Subject: [PATCH] Add 2160p UHD 4K WEB quality. --- CHANGES.md | 1 + gui/slick/css/style.css | 4 + .../default/inc_qualityChooser.tmpl | 2 +- sickbeard/common.py | 18 +- tests/common_tests.py | 212 ++++++++++-------- 5 files changed, 143 insertions(+), 94 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dcd5af98..bdab28e8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -81,6 +81,7 @@ * Add Bit-HDTV torrent provider * Add PrivateHD torrent provider * Add Zooqle torrent provider +* Add 2160p UHD 4K WEB quality ### 0.11.11 (2016-04-05 19:20:00 UTC) diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index 72de3c5d..42adfb84 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -2751,6 +2751,10 @@ span.HD1080p{ background-color:#2672B6 } +span.UHD2160p{ + background-color:#7500FF +} + span.RawHD{ background-color:#cd7300 } diff --git a/gui/slick/interfaces/default/inc_qualityChooser.tmpl b/gui/slick/interfaces/default/inc_qualityChooser.tmpl index 48d1ac78..8770aed2 100644 --- a/gui/slick/interfaces/default/inc_qualityChooser.tmpl +++ b/gui/slick/interfaces/default/inc_qualityChooser.tmpl @@ -11,7 +11,7 @@ preferred episode quality to download diff --git a/sickbeard/common.py b/sickbeard/common.py index 2d34824f..ab97943e 100644 --- a/sickbeard/common.py +++ b/sickbeard/common.py @@ -95,6 +95,9 @@ class Quality: FULLHDWEBDL = 1 << 6 # 64 -- 1080p web-dl HDBLURAY = 1 << 7 # 128 FULLHDBLURAY = 1 << 8 # 256 + # UHD4KTV = 1 << 9 # reserved for the future + UHD4KWEB = 1 << 10 + # UHD4KBLURAY = 1 << 11 # reserved for the future # put these bits at the other end of the spectrum, far enough out that they shouldn't interfere UNKNOWN = 1 << 15 # 32768 @@ -109,7 +112,8 @@ class Quality: HDWEBDL: '720p WEB-DL', FULLHDWEBDL: '1080p WEB-DL', HDBLURAY: '720p BluRay', - FULLHDBLURAY: '1080p BluRay'} + FULLHDBLURAY: '1080p BluRay', + UHD4KWEB: '2160p UHD 4K WEB'} statusPrefixes = {DOWNLOADED: 'Downloaded', SNATCHED: 'Snatched', @@ -209,7 +213,7 @@ class Quality: if checkName(['(pdtv|hdtv|dsr|tvrip)([-]|.((aac|ac3|dd).?\d\.?\d.)*(xvid|x264|h.?264))'], all) and not checkName(['(720|1080|2160)[pi]'], all) \ and not checkName(['hr.ws.pdtv.(x264|h.?264)'], any): return Quality.SDTV - elif checkName(['web.?(dl|rip|.h264)', 'xvid|x264|h.?264'], all) and not checkName(['(720|1080|2160)[pi]'], all): + elif checkName(['web.?(dl|rip|.[hx]26[45])', 'xvid|x26[45]|.?26[45]'], all) and not checkName(['(720|1080|2160)[pi]'], all): return Quality.SDTV elif checkName(['(dvd.?rip|b[r|d]rip)(.ws)?(.(xvid|divx|x264|h.?264))?'], any) and not checkName(['(720|1080|2160)[pi]'], all): return Quality.SDDVD @@ -223,14 +227,16 @@ class Quality: return Quality.RAWHDTV elif checkName(['1080p', 'hdtv', 'x264'], all): return Quality.FULLHDTV - elif checkName(['720p', 'web.?(dl|rip|.h264)'], all) or checkName(['720p', 'itunes', 'x264|h.?264'], all): + elif checkName(['720p', 'web.?(dl|rip|.[hx]26[45])'], all) or checkName(['720p', 'itunes', 'x264|h.?264'], all): return Quality.HDWEBDL - elif checkName(['1080p', 'web.?(dl|rip|.h264)'], all) or checkName(['1080p', 'itunes', 'x264|h.?264'], all): + elif checkName(['1080p', 'web.?(dl|rip|.[hx]26[45])'], all) or checkName(['1080p', 'itunes', 'x264|h.?264'], all): return Quality.FULLHDWEBDL elif checkName(['720p', 'blu.?ray|hddvd|b[r|d]rip', 'x264|h.?264'], all): return Quality.HDBLURAY elif checkName(['1080p', 'blu.?ray|hddvd|b[r|d]rip', 'x264|h.?264'], all): return Quality.FULLHDBLURAY + elif checkName(['2160p', 'web.?(dl|rip|.[hx]26[45])'], all): + return Quality.UHD4KWEB else: return Quality.UNKNOWN @@ -342,6 +348,7 @@ HD = Quality.combineQualities( []) # HD720p + HD1080p HD720p = Quality.combineQualities([Quality.HDTV, Quality.HDWEBDL, Quality.HDBLURAY], []) HD1080p = Quality.combineQualities([Quality.FULLHDTV, Quality.FULLHDWEBDL, Quality.FULLHDBLURAY], []) +UHD2160p = Quality.combineQualities([Quality.UHD4KWEB], []) ANY = Quality.combineQualities( [Quality.SDTV, Quality.SDDVD, Quality.HDTV, Quality.FULLHDTV, Quality.HDWEBDL, Quality.FULLHDWEBDL, Quality.HDBLURAY, Quality.FULLHDBLURAY, Quality.UNKNOWN], []) # SD + HD @@ -349,12 +356,13 @@ ANY = Quality.combineQualities( # legacy template, cant remove due to reference in mainDB upgrade? BEST = Quality.combineQualities([Quality.SDTV, Quality.HDTV, Quality.HDWEBDL], [Quality.HDTV]) -qualityPresets = (SD, HD, HD720p, HD1080p, ANY) +qualityPresets = (SD, HD, HD720p, HD1080p, UHD2160p, ANY) qualityPresetStrings = {SD: 'SD', HD: 'HD', HD720p: 'HD720p', HD1080p: 'HD1080p', + UHD2160p: 'UHD2160p', ANY: 'Any'} diff --git a/tests/common_tests.py b/tests/common_tests.py index 197c51a9..d0c3cf0b 100644 --- a/tests/common_tests.py +++ b/tests/common_tests.py @@ -1,126 +1,162 @@ +from sickbeard import common + import unittest import sys import os.path sys.path.insert(1, os.path.abspath('..')) -from sickbeard import common - class QualityTests(unittest.TestCase): + def check_quality_names(self, quality, cases): + for fn in cases: + second = common.Quality.nameQuality(fn) + self.assertEqual(quality, second, 'fail %s != %s for case: %s' % (quality, second, fn)) + # TODO: repack / proper ? air-by-date ? season rip? multi-ep? def test_SDTV(self): + self.assertEqual(common.Quality.compositeStatus(common.DOWNLOADED, common.Quality.SDTV), common.Quality.statusFromName('Test.Show.S01E02-GROUP.mkv')) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.PDTV.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.PDTV.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.HDTV.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.HDTV.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.DSR.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.DSR.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.TVRip.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.TVRip.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEBRip.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEBRip.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.Web-Rip.x264.GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEB-DL.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEB-DL.AAC2.0.H.264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02 WEB-DL H 264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02_WEB-DL_H_264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEB-DL.AAC2.0.H264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.HDTV.AAC.2.0.x264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.HDTV.DD5.1.XViD-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.HDTV.DD7.1.h.264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEB-DL.DD5.1.h.264-GROUP")) - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test.Show.S01E02.WEB.h264-GROUP")) + self.check_quality_names(common.Quality.SDTV, [ + 'Test.Show.S01E02.PDTV.XViD-GROUP', + 'Test.Show.S01E02.PDTV.x264-GROUP', + 'Test.Show.S01E02.HDTV.XViD-GROUP', + 'Test.Show.S01E02.HDTV.x264-GROUP', + 'Test.Show.S01E02.DSR.XViD-GROUP', + 'Test.Show.S01E02.DSR.x264-GROUP', + 'Test.Show.S01E02.TVRip.XViD-GROUP', + 'Test.Show.S01E02.TVRip.x264-GROUP', + 'Test.Show.S01E02.WEBRip.XViD-GROUP', + 'Test.Show.S01E02.WEBRip.x264-GROUP', + 'Test.Show.S01E02.Web-Rip.x264.GROUP', + 'Test.Show.S01E02.WEB-DL.x264-GROUP', + 'Test.Show.S01E02.WEB-DL.AAC2.0.H.264-GROUP', + 'Test.Show.S01E02 WEB-DL H 264-GROUP', + 'Test.Show.S01E02_WEB-DL_H_264-GROUP', + 'Test.Show.S01E02.WEB-DL.AAC2.0.H264-GROUP', + 'Test.Show.S01E02.HDTV.AAC.2.0.x264-GROUP', + 'Test.Show.S01E02.HDTV.DD5.1.XViD-GROUP', + 'Test.Show.S01E02.HDTV.DD7.1.h.264-GROUP', + 'Test.Show.S01E02.WEB-DL.DD5.1.h.264-GROUP', + 'Test.Show.S01E02.WEB.h264-GROUP', + 'Test.Show.S01E02.WEB.x264-GROUP', + 'Test.Show.S01E02.WEB.h265-GROUP', + 'Test.Show.S01E02.WEB.x265-GROUP', + 'Test.Show.S01E02.WEBRip.h264-GROUP', + 'Test.Show.S01E02.WEBRip.x264-GROUP']) def test_SDDVD(self): - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRiP.XViD-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRiP.DiVX-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRiP.x264-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRip.WS.XViD-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRip.WS.DiVX-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.DVDRip.WS.x264-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show-S01E02-Test.Dvd Rip")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.XViD-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.DiVX-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.x264-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.WS.XViD-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.WS.DiVX-GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test.Show.S01E02.BDRIP.WS.x264-GROUP")) + self.check_quality_names(common.Quality.SDDVD, [ + 'Test.Show.S01E02.DVDRiP.XViD-GROUP', + 'Test.Show.S01E02.DVDRiP.DiVX-GROUP', + 'Test.Show.S01E02.DVDRiP.x264-GROUP', + 'Test.Show.S01E02.DVDRip.WS.XViD-GROUP', + 'Test.Show.S01E02.DVDRip.WS.DiVX-GROUP', + 'Test.Show.S01E02.DVDRip.WS.x264-GROUP', + 'Test.Show-S01E02-Test.Dvd Rip', + 'Test.Show.S01E02.BDRIP.XViD-GROUP', + 'Test.Show.S01E02.BDRIP.DiVX-GROUP', + 'Test.Show.S01E02.BDRIP.x264-GROUP', + 'Test.Show.S01E02.BDRIP.WS.XViD-GROUP', + 'Test.Show.S01E02.BDRIP.WS.DiVX-GROUP', + 'Test.Show.S01E02.BDRIP.WS.x264-GROUP']) def test_HDTV(self): - self.assertEqual(common.Quality.HDTV, common.Quality.nameQuality("Test.Show.S01E02.720p.HDTV.x264-GROUP")) - self.assertEqual(common.Quality.HDTV, common.Quality.nameQuality("Test.Show.S01E02.HR.WS.PDTV.x264-GROUP")) - self.assertEqual(common.Quality.HDTV, common.Quality.nameQuality("Test.Show.S01E02.720p.AHDTV.x264-GROUP")) + self.check_quality_names(common.Quality.HDTV, [ + 'Test.Show.S01E02.720p.HDTV.x264-GROUP', + 'Test.Show.S01E02.HR.WS.PDTV.x264-GROUP', + 'Test.Show.S01E02.720p.AHDTV.x264-GROUP']) def test_RAWHDTV(self): - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test.Show.S01E02.720p.HDTV.DD5.1.MPEG2-GROUP")) - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test.Show.S01E02.1080i.HDTV.DD2.0.MPEG2-GROUP")) - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test.Show.S01E02.1080i.HDTV.H.264.DD2.0-GROUP")) - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test Show - S01E02 - 1080i HDTV MPA1.0 H.264 - GROUP")) - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test.Show.S01E02.1080i.HDTV.DD.5.1.h264-GROUP")) + self.check_quality_names(common.Quality.RAWHDTV, [ + 'Test.Show.S01E02.720p.HDTV.DD5.1.MPEG2-GROUP', + 'Test.Show.S01E02.1080i.HDTV.DD2.0.MPEG2-GROUP', + 'Test.Show.S01E02.1080i.HDTV.H.264.DD2.0-GROUP', + 'Test Show - S01E02 - 1080i HDTV MPA1.0 H.264 - GROUP', + 'Test.Show.S01E02.1080i.HDTV.DD.5.1.h264-GROUP']) def test_FULLHDTV(self): - self.assertEqual(common.Quality.FULLHDTV, common.Quality.nameQuality("Test.Show.S01E02.1080p.HDTV.x264-GROUP")) - self.assertEqual(common.Quality.FULLHDTV, common.Quality.nameQuality("Test.Show.S01E02.1080p.AHDTV.x264-GROUP")) + self.check_quality_names(common.Quality.FULLHDTV, [ + 'Test.Show.S01E02.1080p.HDTV.x264-GROUP', + 'Test.Show.S01E02.1080p.AHDTV.x264-GROUP']) def test_HDWEBDL(self): - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.WEB-DL-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.WEBRip-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.WEBRip.720p.H.264.AAC.2.0-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.WEB-DL.AAC2.0.H.264-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test Show S01E02 720p WEB-DL AAC2 0 H 264-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test_Show.S01E02_720p_WEB-DL_AAC2.0_H264-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.WEB-DL.AAC2.0.H264-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.iTunes.Rip.H264.AAC-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.s01e02.WEBDL.720p.GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test Show s01e02 WEBDL 720p GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test Show S01E02 720p WEB-DL AVC-GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.WEB-RIP.720p.GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.720p.WEB.h264-GROUP")) + self.check_quality_names(common.Quality.HDWEBDL, [ + 'Test.Show.S01E02.720p.WEB-DL-GROUP', + 'Test.Show.S01E02.720p.WEBRip-GROUP', + 'Test.Show.S01E02.WEBRip.720p.H.264.AAC.2.0-GROUP', + 'Test.Show.S01E02.720p.WEB-DL.AAC2.0.H.264-GROUP', + 'Test Show S01E02 720p WEB-DL AAC2 0 H 264-GROUP', + 'Test_Show.S01E02_720p_WEB-DL_AAC2.0_H264-GROUP', + 'Test.Show.S01E02.720p.WEB-DL.AAC2.0.H264-GROUP', + 'Test.Show.S01E02.720p.iTunes.Rip.H264.AAC-GROUP', + 'Test.Show.s01e02.WEBDL.720p.GROUP', + 'Test Show s01e02 WEBDL 720p GROUP', + 'Test Show S01E02 720p WEB-DL AVC-GROUP', + 'Test.Show.S01E02.WEB-RIP.720p.GROUP', + 'Test.Show.S01E02.720p.WEB.h264-GROUP', + 'Test.Show.S01E02.720p.WEB.x264-GROUP', + 'Test.Show.S01E02.720p.WEB.h265-GROUP', + 'Test.Show.S01E02.720p.WEB.x265-GROUP', + 'Test.Show.S01E02.720p.WEBRip.h264-GROUP', + 'Test.Show.S01E02.720p.WEBRip.x264-GROUP']) def test_FULLHDWEBDL(self): - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.1080p.WEB-DL-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.1080p.WEBRip-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.WEBRip.1080p.H.264.AAC.2.0-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.WEBRip.1080p.H264.AAC.2.0-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.1080p.iTunes.H.264.AAC-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test Show S01E02 1080p iTunes H 264 AAC-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test_Show_S01E02_1080p_iTunes_H_264_AAC-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.s01e02.WEBDL.1080p.GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test Show s01e02 WEBDL 1080p GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test Show S01E02 1080p WEB-DL AVC-GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.WEB-RIP.1080p.GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test.Show.S01E02.1080p.WEB.h264-GROUP")) + self.check_quality_names(common.Quality.FULLHDWEBDL, [ + 'Test.Show.S01E02.1080p.WEB-DL-GROUP', + 'Test.Show.S01E02.1080p.WEBRip-GROUP', + 'Test.Show.S01E02.WEBRip.1080p.H.264.AAC.2.0-GROUP', + 'Test.Show.S01E02.WEBRip.1080p.H264.AAC.2.0-GROUP', + 'Test.Show.S01E02.1080p.iTunes.H.264.AAC-GROUP', + 'Test Show S01E02 1080p iTunes H 264 AAC-GROUP', + 'Test_Show_S01E02_1080p_iTunes_H_264_AAC-GROUP', + 'Test.Show.s01e02.WEBDL.1080p.GROUP', + 'Test Show s01e02 WEBDL 1080p GROUP', + 'Test Show S01E02 1080p WEB-DL AVC-GROUP', + 'Test.Show.S01E02.WEB-RIP.1080p.GROUP', + 'Test.Show.S01E02.1080p.WEB.h264-GROUP', + 'Test.Show.S01E02.1080p.WEB.x264-GROUP', + 'Test.Show.S01E02.1080p.WEB.h265-GROUP', + 'Test.Show.S01E02.1080p.WEB.x265-GROUP', + 'Test.Show.S01E02.1080p.WEBRip.h264-GROUP', + 'Test.Show.S01E02.1080p.WEBRip.x264-GROUP']) def test_HDBLURAY(self): - self.assertEqual(common.Quality.HDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.720p.BluRay.x264-GROUP")) - self.assertEqual(common.Quality.HDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.720p.HDDVD.x264-GROUP")) - self.assertEqual(common.Quality.HDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.720p.Blu-ray.x264-GROUP")) + self.check_quality_names(common.Quality.HDBLURAY, [ + 'Test.Show.S01E02.720p.BluRay.x264-GROUP', + 'Test.Show.S01E02.720p.HDDVD.x264-GROUP', + 'Test.Show.S01E02.720p.Blu-ray.x264-GROUP']) def test_FULLHDBLURAY(self): - self.assertEqual(common.Quality.FULLHDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.1080p.BluRay.x264-GROUP")) - self.assertEqual(common.Quality.FULLHDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.1080p.HDDVD.x264-GROUP")) - self.assertEqual(common.Quality.FULLHDBLURAY, common.Quality.nameQuality("Test.Show.S01E02.1080p.Blu-ray.x264-GROUP")) + self.check_quality_names(common.Quality.FULLHDBLURAY, [ + 'Test.Show.S01E02.1080p.BluRay.x264-GROUP', + 'Test.Show.S01E02.1080p.HDDVD.x264-GROUP', + 'Test.Show.S01E02.1080p.Blu-ray.x264-GROUP']) + + def test_UHD4KWEB(self): + self.check_quality_names(common.Quality.UHD4KWEB, [ + 'Test.Show.S01E02.2160p.WEBRip.h264-GROUP', + 'Test.Show.S01E02.2160p.WEBRip.x264-GROUP', + 'Test.Show.S01E02.2160p.WEBRip.x265-GROUP']) def test_UNKNOWN(self): - self.assertEqual(common.Quality.UNKNOWN, common.Quality.nameQuality("Test.Show.S01E02-SiCKBEARD")) + self.check_quality_names(common.Quality.UNKNOWN, ['Test.Show.S01E02-SiCKGEAR']) def test_reverse_parsing(self): - self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("Test Show - S01E02 - SD TV - GROUP")) - self.assertEqual(common.Quality.SDDVD, common.Quality.nameQuality("Test Show - S01E02 - SD DVD - GROUP")) - self.assertEqual(common.Quality.HDTV, common.Quality.nameQuality("Test Show - S01E02 - HD TV - GROUP")) - self.assertEqual(common.Quality.RAWHDTV, common.Quality.nameQuality("Test Show - S01E02 - RawHD TV - GROUP")) - self.assertEqual(common.Quality.FULLHDTV, common.Quality.nameQuality("Test Show - S01E02 - 1080p HD TV - GROUP")) - self.assertEqual(common.Quality.HDWEBDL, common.Quality.nameQuality("Test Show - S01E02 - 720p WEB-DL - GROUP")) - self.assertEqual(common.Quality.FULLHDWEBDL, common.Quality.nameQuality("Test Show - S01E02 - 1080p WEB-DL - GROUP")) - self.assertEqual(common.Quality.HDBLURAY, common.Quality.nameQuality("Test Show - S01E02 - 720p BluRay - GROUP")) - self.assertEqual(common.Quality.FULLHDBLURAY, common.Quality.nameQuality("Test Show - S01E02 - 1080p BluRay - GROUP")) - self.assertEqual(common.Quality.UNKNOWN, common.Quality.nameQuality("Test Show - S01E02 - Unknown - SiCKBEARD")) + self.check_quality_names(common.Quality.SDTV, ['Test Show - S01E02 - SD TV - GROUP']) + self.check_quality_names(common.Quality.SDDVD, ['Test Show - S01E02 - SD DVD - GROUP']) + self.check_quality_names(common.Quality.HDTV, ['Test Show - S01E02 - HD TV - GROUP']) + self.check_quality_names(common.Quality.RAWHDTV, ['Test Show - S01E02 - RawHD TV - GROUP']) + self.check_quality_names(common.Quality.FULLHDTV, ['Test Show - S01E02 - 1080p HD TV - GROUP']) + self.check_quality_names(common.Quality.HDWEBDL, ['Test Show - S01E02 - 720p WEB-DL - GROUP']) + self.check_quality_names(common.Quality.FULLHDWEBDL, ['Test Show - S01E02 - 1080p WEB-DL - GROUP']) + self.check_quality_names(common.Quality.HDBLURAY, ['Test Show - S01E02 - 720p BluRay - GROUP']) + self.check_quality_names(common.Quality.FULLHDBLURAY, ['Test Show - S01E02 - 1080p BluRay - GROUP']) + self.check_quality_names(common.Quality.UNKNOWN, ['Test Show - S01E02 - Unknown - SiCKGEAR']) if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(QualityTests)