Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage-1
Commits
bf4fcfc4
Commit
bf4fcfc4
authored
May 5, 2015
by
Dustyn Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Fix funky Quality Names. Fixes SiCKRAGETV/sickrage-issues#1508
parent
bde875f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sickbeard/common.py
+12
-8
12 additions, 8 deletions
sickbeard/common.py
tests/common_tests.py
+4
-4
4 additions, 4 deletions
tests/common_tests.py
with
16 additions
and
12 deletions
sickbeard/common.py
+
12
−
8
View file @
bf4fcfc4
...
@@ -106,7 +106,7 @@ class Quality:
...
@@ -106,7 +106,7 @@ class Quality:
SDTV
:
"
SDTV
"
,
SDTV
:
"
SDTV
"
,
SDDVD
:
"
SD DVD
"
,
SDDVD
:
"
SD DVD
"
,
HDTV
:
"
HDTV
"
,
HDTV
:
"
HDTV
"
,
RAWHDTV
:
"
RawHD
TV
"
,
RAWHDTV
:
"
RawHD
"
,
FULLHDTV
:
"
1080p HDTV
"
,
FULLHDTV
:
"
1080p HDTV
"
,
HDWEBDL
:
"
720p WEB-DL
"
,
HDWEBDL
:
"
720p WEB-DL
"
,
FULLHDWEBDL
:
"
1080p WEB-DL
"
,
FULLHDWEBDL
:
"
1080p WEB-DL
"
,
...
@@ -156,21 +156,25 @@ class Quality:
...
@@ -156,21 +156,25 @@ class Quality:
If no quality is achieved it will try sceneQuality regex
If no quality is achieved it will try sceneQuality regex
"""
"""
#Try Scene names first
quality
=
Quality
.
sceneQuality
(
name
,
anime
)
if
quality
!=
Quality
.
UNKNOWN
:
return
quality
name
=
os
.
path
.
basename
(
name
)
name
=
os
.
path
.
basename
(
name
)
# if we have our exact text then assume we put it there
# if we have our exact text then assume we put it there
for
x
in
sorted
(
Quality
.
qualityStrings
.
keys
(),
reverse
=
True
):
for
x
in
sorted
(
Quality
.
qualityStrings
.
keys
(),
reverse
=
True
):
if
x
==
Quality
.
UNKNOWN
:
if
x
==
Quality
.
UNKNOWN
or
x
==
Quality
.
NONE
:
continue
continue
if
x
==
Quality
.
NONE
:
#Last chance
return
Quality
.
sceneQuality
(
name
,
anime
)
regex
=
'
\W
'
+
Quality
.
qualityStrings
[
x
].
replace
(
'
'
,
'
\W
'
)
+
'
\W
'
regex
=
'
\W
'
+
Quality
.
qualityStrings
[
x
].
replace
(
'
'
,
'
\W
'
)
+
'
\W
'
regex_match
=
re
.
search
(
regex
,
name
,
re
.
I
)
regex_match
=
re
.
search
(
regex
,
name
,
re
.
I
)
if
regex_match
:
if
regex_match
:
return
x
return
x
return
Quality
.
UNKNOWN
@staticmethod
@staticmethod
def
sceneQuality
(
name
,
anime
=
False
):
def
sceneQuality
(
name
,
anime
=
False
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
tests/common_tests.py
+
4
−
4
View file @
bf4fcfc4
...
@@ -91,7 +91,7 @@ class QualityTests(unittest.TestCase):
...
@@ -91,7 +91,7 @@ class QualityTests(unittest.TestCase):
self
.
assertEqual
(
common
.
Quality
.
SDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - SDTV - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
SDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - SDTV - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
SDDVD
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - SD DVD - 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 - HDTV - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
HDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - HDTV - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
RAWHDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - RawHD
TV
- GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
RAWHDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - RawHD - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
FULLHDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - 1080p HDTV - GROUP
"
))
self
.
assertEqual
(
common
.
Quality
.
FULLHDTV
,
common
.
Quality
.
nameQuality
(
"
Test Show - S01E02 - 1080p HDTV - GROUP
"
))
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 WEB-DL - GROUP
"
))
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 WEB-DL - GROUP
"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment