Refactor utility location configuration

This commit is contained in:
Labrys of Knossos 2019-01-19 12:43:02 -05:00
commit 3d2070e106

View file

@ -934,48 +934,13 @@ def configure_sections(section):
CATEGORIES = list(set(CATEGORIES)) CATEGORIES = list(set(CATEGORIES))
def initialize(section=None): def configure_utility_locations():
global SHOWEXTRACT global SHOWEXTRACT
global CATEGORIES
global SECTIONS
global SEVENZIP global SEVENZIP
global __INITIALIZED__
global USER_DELAY
global SYS_ENCODING
global FFMPEG global FFMPEG
global FFPROBE global FFPROBE
global TORRENT_CLASS
global PASSWORDS_FILE
global PAR2CMD global PAR2CMD
if __INITIALIZED__:
return False
configure_logging()
configure_process()
configure_locale()
# init logging
logger.ntm_log_instance.init_logging()
configure_migration()
configure_logging_part_2()
# initialize the main SB database
main_db.upgrade_database(main_db.DBConnection(), databases.InitialSchema)
configure_general()
configure_updates()
configure_wake_on_lan()
configure_nzbs()
configure_torrents()
configure_remote_paths()
configure_plex()
configure_niceness()
configure_containers()
configure_transcoder()
configure_passwords_file()
# Setup FFMPEG, FFPROBE and SEVENZIP locations # Setup FFMPEG, FFPROBE and SEVENZIP locations
if platform.system() == 'Windows': if platform.system() == 'Windows':
FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe') FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe')
@ -1064,6 +1029,38 @@ def initialize(section=None):
logger.warning('Failed to locate ffprobe. Video corruption detection disabled!') logger.warning('Failed to locate ffprobe. Video corruption detection disabled!')
logger.warning('Install ffmpeg with x264 support to enable this feature ...') logger.warning('Install ffmpeg with x264 support to enable this feature ...')
def initialize(section=None):
global __INITIALIZED__
if __INITIALIZED__:
return False
configure_logging()
configure_process()
configure_locale()
# init logging
logger.ntm_log_instance.init_logging()
configure_migration()
configure_logging_part_2()
# initialize the main SB database
main_db.upgrade_database(main_db.DBConnection(), databases.InitialSchema)
configure_general()
configure_updates()
configure_wake_on_lan()
configure_nzbs()
configure_torrents()
configure_remote_paths()
configure_plex()
configure_niceness()
configure_containers()
configure_transcoder()
configure_passwords_file()
configure_utility_locations()
configure_sections(section) configure_sections(section)
configure_torrent_class() configure_torrent_class()