Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use the process_failed method, when USE_FAILED_DOWNLOADS is enab… #10435

Merged
merged 2 commits into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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