Skip to content

Commit

Permalink
Only use the process_failed method, when USE_FAILED_DOWNLOADS is enab… (
Browse files Browse the repository at this point in the history
#10435)

* Only use the process_failed method, when USE_FAILED_DOWNLOADS is enabled.

* comment
  • Loading branch information
p0psicles authored Mar 26, 2022
1 parent 78fe427 commit a2e7fdb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion medusa/failed_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def _process_release_name(self):
segment.append(parse_result.series.get_episode(parse_result.season_number, episode))

if segment:
self.log(logger.DEBUG, 'Adding this release to failed queue: {release}'.format(release=release_name))
self.log(logger.DEBUG, 'Created segment of episodes [{segment}] from release: {release}'.format(
segment=','.join(ep.episode for ep in segment),
release=release_name
))

return segment

Expand Down
11 changes: 7 additions & 4 deletions medusa/process_tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ def process_path(self):

# A user might want to use advanced post-processing, but opt-out of failed download handling.
if (
app.USE_FAILED_DOWNLOADS
and self.process_single_resource
self.process_single_resource
and (process_results.failed or not process_results.succeeded)
):
process_results.process_failed(self.path)
Expand Down Expand Up @@ -232,8 +231,9 @@ def run(self, force=False, **kwargs):
process_results = ProcessResult(path, process_method, failed=failed)
process_results.process(force=force, **kwargs)

# Only initiate failed download handling, if enabled.
if process_results.failed and app.USE_FAILED_DOWNLOADS:
# Only initiate failed download handling,
# if process result has failed and failed download handling is enabled.
if process_results.failed:
process_results.process_failed(path)

return process_results.output
Expand Down Expand Up @@ -927,6 +927,9 @@ def _process_postponed(self, processor, path, video, ignore_subs):

def process_failed(self, path, resource_name=None):
"""Process a download that did not complete correctly."""
if not app.USE_FAILED_DOWNLOADS:
return

try:
processor = failed_processor.FailedProcessor(
path, resource_name or self.resource_name, self.episodes
Expand Down

0 comments on commit a2e7fdb

Please sign in to comment.