Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
@fernandog
What do you say?
  • Loading branch information
medariox committed May 29, 2016
1 parent 8b8c2bf commit 51c932a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sickbeard/subtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,15 +722,14 @@ def subtitles_download_in_pp(): # pylint: disable=too-many-locals, too-many-bra

if not isMediaFile(filename):
continue

filename = os.path.basename(clear_non_release_groups(os.path.join(root, filename)))

if processTV.subtitles_enabled(filename) is False:
logger.debug(u'Subtitle disabled for show: %s', filename)
video_path = clear_non_release_groups(os.path.join(root, filename))

if processTV.subtitles_enabled(video_path) is False:
logger.debug(u'Subtitle disabled for show: %s', video_path)
continue

video_path = os.path.join(root, filename)
release_name = os.path.splitext(filename)[0]
release_name = os.path.splitext(os.path.basename(video_path))[0]
found_subtitles = download_best_subs(video_path, root, release_name, languages, subtitles=False,
embedded_subtitles=False, provider_pool=pool)
downloaded_languages = {s.language.opensubtitles for s in found_subtitles}
Expand Down

0 comments on commit 51c932a

Please sign in to comment.