From 2c15c79fb736cdc6fcac5ce80dcafef9bc28d9ef Mon Sep 17 00:00:00 2001 From: Dario Date: Tue, 23 Oct 2018 11:49:20 +0200 Subject: [PATCH] Standardize processing method (#5471) * Standardize processing method * Typo --- medusa/name_parser/rules/rules.py | 2 +- medusa/post_processor.py | 7 +++---- medusa/process_tv.py | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/medusa/name_parser/rules/rules.py b/medusa/name_parser/rules/rules.py index 3d5bd84d81..2f13488f7f 100644 --- a/medusa/name_parser/rules/rules.py +++ b/medusa/name_parser/rules/rules.py @@ -1173,7 +1173,7 @@ def when(self, matches, context): first_title = titles[0] last_title = titles[-1] - # Always use the first langauge + # Always use the first language first_language = languages[0] for language in languages[1:]: if language.start < first_language.start: diff --git a/medusa/post_processor.py b/medusa/post_processor.py index 38ea2b1989..2b85b84af8 100644 --- a/medusa/post_processor.py +++ b/medusa/post_processor.py @@ -110,7 +110,7 @@ def __init__(self, file_path, nzb_name=None, process_method=None, is_priority=No # relative path to the file that is being processed self.rel_path = self._get_rel_path() self.nzb_name = nzb_name - self.process_method = process_method if process_method else app.PROCESS_METHOD + self.process_method = process_method or app.PROCESS_METHOD self.in_history = False self.release_group = None self.release_name = None @@ -1304,9 +1304,8 @@ def process(self): self._run_extra_scripts(ep_obj) - if not self.nzb_name and all([app.USE_TORRENTS, - app.PROCESS_METHOD in ('hardlink', 'symlink', 'reflink'), - app.TORRENT_SEED_LOCATION]): + if not self.nzb_name and all([app.USE_TORRENTS, app.TORRENT_SEED_LOCATION, + self.process_method in ('hardlink', 'symlink', 'reflink')]): # Store self.info_hash and self.release_name so later we can remove from client if setting is enabled if self.info_hash: existing_release_names = app.RECENTLY_POSTPROCESSED.get(self.info_hash, []) diff --git a/medusa/process_tv.py b/medusa/process_tv.py index a873e886fa..2205bb90ca 100644 --- a/medusa/process_tv.py +++ b/medusa/process_tv.py @@ -32,7 +32,7 @@ def __init__(self, path, process_method=None): self._output = [] self.directory = path - self.process_method = process_method + self.process_method = process_method or app.PROCESS_METHOD self.resource_name = None self.result = True self.succeeded = True @@ -166,7 +166,8 @@ def process(self, resource_name=None, force=False, is_priority=None, delete_on=F for missedfile in self.missedfiles: self.log('{0}'.format(missedfile), logger.WARNING) - if app.USE_TORRENTS and app.PROCESS_METHOD in ('hardlink', 'symlink', 'reflink') and app.TORRENT_SEED_LOCATION: + if all([app.USE_TORRENTS, app.TORRENT_SEED_LOCATION, + self.process_method in ('hardlink', 'symlink', 'reflink')]): for info_hash, release_names in list(iteritems(app.RECENTLY_POSTPROCESSED)): if self.move_torrent(info_hash, release_names): app.RECENTLY_POSTPROCESSED.pop(info_hash, None)