From a24367113b95b2ddf9b1d5bef393462a20b29cac Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Sat, 19 Jan 2019 00:14:48 -0500 Subject: [PATCH] Refactor OUTPUTDIRECTORY -> OUTPUT_DIRECTORY --- TorrentToMedia.py | 6 +++--- core/__init__.py | 6 +++--- core/utils/common.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 9042fea1..2e316d12 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -114,13 +114,13 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp basename = os.path.basename(input_directory) basename = core.sanitize_name(input_name) \ if input_name == basename else os.path.splitext(core.sanitize_name(input_name))[0] - output_destination = os.path.join(core.OUTPUTDIRECTORY, input_category, basename) + output_destination = os.path.join(core.OUTPUT_DIRECTORY, input_category, basename) elif unique_path: output_destination = os.path.normpath( - core.os.path.join(core.OUTPUTDIRECTORY, input_category, core.sanitize_name(input_name).replace(' ', '.'))) + core.os.path.join(core.OUTPUT_DIRECTORY, input_category, core.sanitize_name(input_name).replace(' ', '.'))) else: output_destination = os.path.normpath( - core.os.path.join(core.OUTPUTDIRECTORY, input_category)) + core.os.path.join(core.OUTPUT_DIRECTORY, input_category)) try: output_destination = output_destination.encode(core.SYS_ENCODING) except UnicodeError: diff --git a/core/__init__.py b/core/__init__.py index 99d3b974..5c04fc4e 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -140,7 +140,7 @@ NZB_DEFAULTDIR = None TORRENT_CLIENTAGENT = None TORRENT_CLASS = None USE_LINK = None -OUTPUTDIRECTORY = None +OUTPUT_DIRECTORY = None NOFLATTEN = [] DELETE_ORIGINAL = None TORRENT_CHMOD_DIRECTORY = None @@ -255,7 +255,7 @@ def initialize(section=None): global NZBGET_POSTPROCESS_ERROR, NZBGET_POSTPROCESS_NONE, NZBGET_POSTPROCESS_PAR_CHECK, NZBGET_POSTPROCESS_SUCCESS, \ NZBTOMEDIA_TIMEOUT, FORKS, FORK_DEFAULT, FORK_FAILED_TORRENT, FORK_FAILED, NOEXTRACTFAILED, SHOWEXTRACT, \ NZBTOMEDIA_BRANCH, NZBTOMEDIA_VERSION, NEWEST_VERSION, NEWEST_VERSION_STRING, VERSION_NOTIFY, SYS_ARGV, CFG, \ - SABNZB_NO_OF_ARGUMENTS, SABNZB_0717_NO_OF_ARGUMENTS, CATEGORIES, TORRENT_CLIENTAGENT, USE_LINK, OUTPUTDIRECTORY, \ + SABNZB_NO_OF_ARGUMENTS, SABNZB_0717_NO_OF_ARGUMENTS, CATEGORIES, TORRENT_CLIENTAGENT, USE_LINK, OUTPUT_DIRECTORY, \ NOFLATTEN, UTORRENT_PASSWORD, UTORRENT_USER, UTORRENT_WEB_UI, DELUGE_HOST, DELUGE_PORT, DELUGE_USER, DELUGE_PASSWORD, VLEVEL, \ TRANSMISSION_HOST, TRANSMISSION_PORT, TRANSMISSION_PASSWORD, TRANSMISSION_USER, COMPRESSEDCONTAINER, MEDIACONTAINER, \ METACONTAINER, SECTIONS, ALL_FORKS, TEST_FILE, GENERALOPTS, LOG_GIT, GROUPS, SEVENZIP, CONCAT, VCRF, \ @@ -394,7 +394,7 @@ def initialize(section=None): TORRENT_CLIENTAGENT = CFG['Torrent']['clientAgent'] # utorrent | deluge | transmission | rtorrent | vuze | qbittorrent |other USE_LINK = CFG['Torrent']['useLink'] # no | hard | sym - OUTPUTDIRECTORY = CFG['Torrent']['outputDirectory'] # /abs/path/to/complete/ + OUTPUT_DIRECTORY = CFG['Torrent']['outputDirectory'] # /abs/path/to/complete/ TORRENT_DEFAULTDIR = CFG['Torrent']['default_downloadDirectory'] CATEGORIES = (CFG['Torrent']['categories']) # music,music_videos,pictures,software NOFLATTEN = (CFG['Torrent']['noFlatten']) diff --git a/core/utils/common.py b/core/utils/common.py index c2f9ef79..5ecdf830 100644 --- a/core/utils/common.py +++ b/core/utils/common.py @@ -102,11 +102,11 @@ def get_dirs(section, subsection, link='hard'): if core.USE_LINK == 'move': try: - output_directory = os.path.join(core.OUTPUTDIRECTORY, subsection) + output_directory = os.path.join(core.OUTPUT_DIRECTORY, subsection) if os.path.exists(output_directory): to_return.extend(process_dir(output_directory, link)) except Exception as e: - logger.error('Failed to add directories from {0} for post-processing: {1}'.format(core.OUTPUTDIRECTORY, e)) + logger.error('Failed to add directories from {0} for post-processing: {1}'.format(core.OUTPUT_DIRECTORY, e)) if not to_return: logger.debug('No directories identified in {0}:{1} for post-processing'.format(section, subsection))