Private GIT

Skip to content
Snippets Groups Projects
Commit eb83a7c4 authored by miigotu's avatar miigotu
Browse files

Merge pull request #2542 from SiCKRAGETV/better-quality-guess

Try to fix SiCKRAGETV/sickrage-issues/issues/2841
parents 5f005f4b 2c67cca3
Branches
Tags
No related merge requests found
...@@ -274,9 +274,9 @@ class Quality: ...@@ -274,9 +274,9 @@ class Quality:
return Quality.RAWHDTV return Quality.RAWHDTV
elif checkName(["1080p", "hdtv", "x26[45]"], all): elif checkName(["1080p", "hdtv", "x26[45]"], all):
return Quality.FULLHDTV return Quality.FULLHDTV
elif checkName(["720p", "web.dl|webrip"], all) or checkName(["720p", "itunes", "h.?26[45]"], all): elif checkName(["720p", "web.?dl|webrip"], all) or checkName(["720p", "itunes", "h.?26[45]"], all):
return Quality.HDWEBDL return Quality.HDWEBDL
elif checkName(["1080p", "web.dl|webrip"], all) or checkName(["1080p", "itunes", "h.?26[45]"], all): elif checkName(["1080p", "web.?dl|webrip"], all) or checkName(["1080p", "itunes", "h.?26[45]"], all):
return Quality.FULLHDWEBDL return Quality.FULLHDWEBDL
elif checkName(["720p", "blue?-?ray|hddvd|b[rd]rip", "x26[45]"], all): elif checkName(["720p", "blue?-?ray|hddvd|b[rd]rip", "x26[45]"], all):
return Quality.HDBLURAY return Quality.HDBLURAY
...@@ -347,14 +347,19 @@ class Quality: ...@@ -347,14 +347,19 @@ class Quality:
if not height: if not height:
return Quality.UNKNOWN return Quality.UNKNOWN
if height > 1040: base_filename = os.path.basename(filename)
return Quality.FULLHDTV bluray = re.search(r'blue?-?ray', base_filename, re.I) is not None
elif height > 680 and height < 760: webdl = re.search(r'web-?dl', base_filename, re.I) is not None
return Quality.HDTV
ret = Quality.UNKNOWN
if height > 1000:
ret = ((Quality.FULLHDTV, Quality.FULLHDBLURAY)[bluray], FULLHDWEBDL)[webdl]
elif height > 680 and height < 800:
ret = ((Quality.HDTV, Quality.HDBLURAY)[bluray], Quality.HDWEBDL)[webdl]
elif height < 680: elif height < 680:
return Quality.SDTV ret = (Quality.SDTV, Quality.SDDVD)[re.search(r'dvd', base_filename, re.I) is not None]
return Quality.UNKNOWN return ret
@staticmethod @staticmethod
def compositeStatus(status, quality): def compositeStatus(status, quality):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment