From a2e7fdb300a3f1be000d31334729bc7e9fb59b77 Mon Sep 17 00:00:00 2001 From: p0ps Date: Sat, 26 Mar 2022 20:59:13 +0100 Subject: [PATCH] =?UTF-8?q?Only=20use=20the=20process=5Ffailed=20method,?= =?UTF-8?q?=20when=20USE=5FFAILED=5FDOWNLOADS=20is=20enab=E2=80=A6=20(#104?= =?UTF-8?q?35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Only use the process_failed method, when USE_FAILED_DOWNLOADS is enabled. * comment --- medusa/failed_processor.py | 5 ++++- medusa/process_tv.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/medusa/failed_processor.py b/medusa/failed_processor.py index 414d687b58..ce4f2ecae4 100644 --- a/medusa/failed_processor.py +++ b/medusa/failed_processor.py @@ -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 diff --git a/medusa/process_tv.py b/medusa/process_tv.py index ae4ac87a74..9e80ea8f77 100644 --- a/medusa/process_tv.py +++ b/medusa/process_tv.py @@ -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) @@ -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 @@ -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