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
f9022cbb
Commit
f9022cbb
authored
Dec 27, 2015
by
medariox
Browse files
Options
Downloads
Patches
Plain Diff
Avoid iteration on empty exisiting_subtitles, renamed few variables, might fix issue #340
parent
1512ffe0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/subtitles.py
+7
-7
7 additions, 7 deletions
sickbeard/subtitles.py
with
7 additions
and
7 deletions
sickbeard/subtitles.py
+
7
−
7
View file @
f9022cbb
...
@@ -195,11 +195,11 @@ def download_subtitles(subtitles_info): # pylint: disable=too-many-locals, too-
...
@@ -195,11 +195,11 @@ def download_subtitles(subtitles_info): # pylint: disable=too-many-locals, too-
subtitles_info
[
'
episode
'
]),
logger
.
DEBUG
)
subtitles_info
[
'
episode
'
]),
logger
.
DEBUG
)
return
existing_subtitles
,
None
return
existing_subtitles
,
None
for
sub
in
subtitles_list
:
for
sub
title
in
subtitles_list
:
matches
=
sub
.
get_matches
(
video
,
hearing_impaired
=
False
)
matches
=
sub
title
.
get_matches
(
video
,
hearing_impaired
=
False
)
score
=
subliminal
.
subtitle
.
compute_score
(
matches
,
video
)
score
=
subliminal
.
subtitle
.
compute_score
(
matches
,
video
)
logger
.
log
(
u
"
[%s] Subtitle score for %s is: %s (min=%s)
"
logger
.
log
(
u
"
[%s] Subtitle score for %s is: %s (min=%s)
"
%
(
sub
.
provider_name
,
sub
.
id
,
score
,
user_score
),
logger
.
DEBUG
)
%
(
sub
title
.
provider_name
,
sub
title
.
id
,
score
,
user_score
),
logger
.
DEBUG
)
found_subtitles
=
pool
.
download_best_subtitles
(
subtitles_list
,
video
,
languages
=
languages
,
found_subtitles
=
pool
.
download_best_subtitles
(
subtitles_list
,
video
,
languages
=
languages
,
hearing_impaired
=
sickbeard
.
SUBTITLES_HEARING_IMPAIRED
,
hearing_impaired
=
sickbeard
.
SUBTITLES_HEARING_IMPAIRED
,
...
@@ -238,7 +238,7 @@ def download_subtitles(subtitles_info): # pylint: disable=too-many-locals, too-
...
@@ -238,7 +238,7 @@ def download_subtitles(subtitles_info): # pylint: disable=too-many-locals, too-
run_subs_extra_scripts
(
subtitles_info
,
subtitle
,
video
,
single
=
not
sickbeard
.
SUBTITLES_MULTI
)
run_subs_extra_scripts
(
subtitles_info
,
subtitle
,
video
,
single
=
not
sickbeard
.
SUBTITLES_MULTI
)
new_subtitles
=
sorted
({
subtitle
.
language
.
opensubtitles
for
subtitle
in
found_subtitles
})
new_subtitles
=
sorted
({
subtitle
.
language
.
opensubtitles
for
subtitle
in
found_subtitles
})
current_subtitles
=
sorted
({
subtitle
for
subtitle
in
new_subtitles
+
existing_subtitles
})
current_subtitles
=
sorted
({
subtitle
for
subtitle
in
new_subtitles
+
existing_subtitles
})
if
existing_subtitles
else
new_subtitles
if
not
sickbeard
.
SUBTITLES_MULTI
and
len
(
found_subtitles
)
==
1
:
if
not
sickbeard
.
SUBTITLES_MULTI
and
len
(
found_subtitles
)
==
1
:
new_code
=
found_subtitles
[
0
].
language
.
opensubtitles
new_code
=
found_subtitles
[
0
].
language
.
opensubtitles
if
new_code
not
in
existing_subtitles
:
if
new_code
not
in
existing_subtitles
:
...
@@ -371,11 +371,11 @@ class SubtitlesFinder(object):
...
@@ -371,11 +371,11 @@ class SubtitlesFinder(object):
min_score
=
user_score
,
min_score
=
user_score
,
only_one
=
not
sickbeard
.
SUBTITLES_MULTI
)
only_one
=
not
sickbeard
.
SUBTITLES_MULTI
)
for
sub
in
subtitles_list
:
for
sub
title
in
subtitles_list
:
matches
=
sub
.
get_matches
(
video
,
hearing_impaired
=
False
)
matches
=
sub
title
.
get_matches
(
video
,
hearing_impaired
=
False
)
score
=
subliminal
.
subtitle
.
compute_score
(
matches
,
video
)
score
=
subliminal
.
subtitle
.
compute_score
(
matches
,
video
)
logger
.
log
(
u
"
[%s] Subtitle score for %s is: %s (min=%s)
"
logger
.
log
(
u
"
[%s] Subtitle score for %s is: %s (min=%s)
"
%
(
sub
.
provider_name
,
sub
.
id
,
score
,
user_score
),
logger
.
DEBUG
)
%
(
sub
title
.
provider_name
,
sub
title
.
id
,
score
,
user_score
),
logger
.
DEBUG
)
downloaded_languages
=
set
()
downloaded_languages
=
set
()
for
subtitle
in
found_subtitles
:
for
subtitle
in
found_subtitles
:
...
...
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