mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Refactor PASSWORDSFILE -> PASSWORDS_FILE
Refactor DOWNLOADINFO -> DOWNLOAD_INFO
This commit is contained in:
parent
7e52aec4af
commit
0c98912b76
4 changed files with 18 additions and 18 deletions
|
@ -22,7 +22,7 @@ def process_torrent(input_directory, input_name, input_category, input_hash, inp
|
||||||
root = 0
|
root = 0
|
||||||
found_file = 0
|
found_file = 0
|
||||||
|
|
||||||
if client_agent != 'manual' and not core.DOWNLOADINFO:
|
if client_agent != 'manual' and not core.DOWNLOAD_INFO:
|
||||||
logger.debug('Adding TORRENT download info for directory {0} to database'.format(input_directory))
|
logger.debug('Adding TORRENT download info for directory {0} to database'.format(input_directory))
|
||||||
|
|
||||||
my_db = main_db.DBConnection()
|
my_db = main_db.DBConnection()
|
||||||
|
@ -328,11 +328,11 @@ def main(args):
|
||||||
|
|
||||||
logger.info('Checking database for download info for {0} ...'.format
|
logger.info('Checking database for download info for {0} ...'.format
|
||||||
(os.path.basename(dir_name)))
|
(os.path.basename(dir_name)))
|
||||||
core.DOWNLOADINFO = core.get_download_info(os.path.basename(dir_name), 0)
|
core.DOWNLOAD_INFO = core.get_download_info(os.path.basename(dir_name), 0)
|
||||||
if core.DOWNLOADINFO:
|
if core.DOWNLOAD_INFO:
|
||||||
client_agent = text_type(core.DOWNLOADINFO[0].get('client_agent', 'manual'))
|
client_agent = text_type(core.DOWNLOAD_INFO[0].get('client_agent', 'manual'))
|
||||||
input_hash = text_type(core.DOWNLOADINFO[0].get('input_hash', ''))
|
input_hash = text_type(core.DOWNLOAD_INFO[0].get('input_hash', ''))
|
||||||
input_id = text_type(core.DOWNLOADINFO[0].get('input_id', ''))
|
input_id = text_type(core.DOWNLOAD_INFO[0].get('input_id', ''))
|
||||||
logger.info('Found download info for {0}, '
|
logger.info('Found download info for {0}, '
|
||||||
'setting variables now ...'.format(os.path.basename(dir_name)))
|
'setting variables now ...'.format(os.path.basename(dir_name)))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -236,8 +236,8 @@ CHECK_MEDIA = None
|
||||||
NICENESS = []
|
NICENESS = []
|
||||||
HWACCEL = False
|
HWACCEL = False
|
||||||
|
|
||||||
PASSWORDSFILE = None
|
PASSWORDS_FILE = None
|
||||||
DOWNLOADINFO = None
|
DOWNLOAD_INFO = None
|
||||||
GROUPS = None
|
GROUPS = None
|
||||||
|
|
||||||
USER_SCRIPT_MEDIAEXTENSIONS = None
|
USER_SCRIPT_MEDIAEXTENSIONS = None
|
||||||
|
@ -266,8 +266,8 @@ def initialize(section=None):
|
||||||
ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \
|
ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \
|
||||||
SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, HWACCEL, LOG_DIR, LOG_FILE, \
|
SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, HWACCEL, LOG_DIR, LOG_FILE, \
|
||||||
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIO_CONTAINER, EXT_CONTAINER, TORRENT_CLASS, \
|
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIO_CONTAINER, EXT_CONTAINER, TORRENT_CLASS, \
|
||||||
DELETE_ORIGINAL, TORRENT_CHMOD_DIRECTORY, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
DELETE_ORIGINAL, TORRENT_CHMOD_DIRECTORY, PASSWORDS_FILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
||||||
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, CHECK_MEDIA, SAFE_MODE, \
|
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOAD_INFO, CHECK_MEDIA, SAFE_MODE, \
|
||||||
TORRENT_DEFAULT_DIRECTORY, TORRENT_RESUME_ON_FAILURE, NZB_DEFAULT_DIRECTORY, REMOTE_PATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \
|
TORRENT_DEFAULT_DIRECTORY, TORRENT_RESUME_ON_FAILURE, NZB_DEFAULT_DIRECTORY, REMOTE_PATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \
|
||||||
PLEX_SSL, PLEX_HOST, PLEX_PORT, PLEX_TOKEN, PLEX_SECTION, TORRENT_RESUME, PAR2CMD, QBITTORRENT_HOST, QBITTORRENT_PORT, QBITTORRENT_USER, QBITTORRENT_PASSWORD
|
PLEX_SSL, PLEX_HOST, PLEX_PORT, PLEX_TOKEN, PLEX_SECTION, TORRENT_RESUME, PAR2CMD, QBITTORRENT_HOST, QBITTORRENT_PORT, QBITTORRENT_USER, QBITTORRENT_PASSWORD
|
||||||
|
|
||||||
|
@ -763,7 +763,7 @@ def initialize(section=None):
|
||||||
extra = [item for item in codec_alias[codec] if item not in ACODEC3_ALLOW]
|
extra = [item for item in codec_alias[codec] if item not in ACODEC3_ALLOW]
|
||||||
ACODEC3_ALLOW.extend(extra)
|
ACODEC3_ALLOW.extend(extra)
|
||||||
|
|
||||||
PASSWORDSFILE = CFG['passwords']['PassWordFile']
|
PASSWORDS_FILE = CFG['passwords']['PassWordFile']
|
||||||
|
|
||||||
# Setup FFMPEG, FFPROBE and SEVENZIP locations
|
# Setup FFMPEG, FFPROBE and SEVENZIP locations
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
|
|
|
@ -90,8 +90,8 @@ def extract(file_path, output_destination):
|
||||||
# Create outputDestination folder
|
# Create outputDestination folder
|
||||||
core.make_dir(output_destination)
|
core.make_dir(output_destination)
|
||||||
|
|
||||||
if core.PASSWORDSFILE and os.path.isfile(os.path.normpath(core.PASSWORDSFILE)):
|
if core.PASSWORDS_FILE and os.path.isfile(os.path.normpath(core.PASSWORDS_FILE)):
|
||||||
passwords = [line.strip() for line in open(os.path.normpath(core.PASSWORDSFILE))]
|
passwords = [line.strip() for line in open(os.path.normpath(core.PASSWORDS_FILE))]
|
||||||
else:
|
else:
|
||||||
passwords = []
|
passwords = []
|
||||||
|
|
||||||
|
|
|
@ -657,7 +657,7 @@ def process(input_directory, input_name=None, status=0, client_agent='manual', d
|
||||||
if not download_id and client_agent == 'sabnzbd':
|
if not download_id and client_agent == 'sabnzbd':
|
||||||
download_id = get_nzoid(input_name)
|
download_id = get_nzoid(input_name)
|
||||||
|
|
||||||
if client_agent != 'manual' and not core.DOWNLOADINFO:
|
if client_agent != 'manual' and not core.DOWNLOAD_INFO:
|
||||||
logger.debug('Adding NZB download info for directory {0} to database'.format(input_directory))
|
logger.debug('Adding NZB download info for directory {0} to database'.format(input_directory))
|
||||||
|
|
||||||
my_db = main_db.DBConnection()
|
my_db = main_db.DBConnection()
|
||||||
|
@ -899,13 +899,13 @@ def main(args, section=None):
|
||||||
logger.info('Starting manual run for {0}:{1} - Folder: {2}'.format(section, subsection, dir_name))
|
logger.info('Starting manual run for {0}:{1} - Folder: {2}'.format(section, subsection, dir_name))
|
||||||
logger.info('Checking database for download info for {0} ...'.format(os.path.basename(dir_name)))
|
logger.info('Checking database for download info for {0} ...'.format(os.path.basename(dir_name)))
|
||||||
|
|
||||||
core.DOWNLOADINFO = get_download_info(os.path.basename(dir_name), 0)
|
core.DOWNLOAD_INFO = get_download_info(os.path.basename(dir_name), 0)
|
||||||
if core.DOWNLOADINFO:
|
if core.DOWNLOAD_INFO:
|
||||||
logger.info('Found download info for {0}, '
|
logger.info('Found download info for {0}, '
|
||||||
'setting variables now ...'.format
|
'setting variables now ...'.format
|
||||||
(os.path.basename(dir_name)))
|
(os.path.basename(dir_name)))
|
||||||
client_agent = text_type(core.DOWNLOADINFO[0].get('client_agent', 'manual'))
|
client_agent = text_type(core.DOWNLOAD_INFO[0].get('client_agent', 'manual'))
|
||||||
download_id = text_type(core.DOWNLOADINFO[0].get('input_id', ''))
|
download_id = text_type(core.DOWNLOAD_INFO[0].get('input_id', ''))
|
||||||
else:
|
else:
|
||||||
logger.info('Unable to locate download info for {0}, '
|
logger.info('Unable to locate download info for {0}, '
|
||||||
'continuing to try and process this release ...'.format
|
'continuing to try and process this release ...'.format
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue