mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Added a chcek for sample cfg file and if not found it copies the .cfg to .sample and runs migratecfg so it can check the cfg over and make sure its not missing any sections, options, or values and migrates old cfg style to new cfg style.
This commit is contained in:
parent
6d45257035
commit
e51ff81dbe
1 changed files with 6 additions and 1 deletions
|
@ -261,6 +261,7 @@
|
||||||
### NZBGET POST-PROCESSING SCRIPT ###
|
### NZBGET POST-PROCESSING SCRIPT ###
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
import shutil
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import autoProcess.autoProcessComics as autoProcessComics
|
import autoProcess.autoProcessComics as autoProcessComics
|
||||||
|
@ -278,9 +279,13 @@ POSTPROCESS_SUCCESS = 93
|
||||||
POSTPROCESS_ERROR = 94
|
POSTPROCESS_ERROR = 94
|
||||||
POSTPROCESS_NONE = 95
|
POSTPROCESS_NONE = 95
|
||||||
|
|
||||||
# check to migrate old cfg before trying to load.
|
# run migrate to convert old cfg to new style cfg plus fix any cfg missing values/options.
|
||||||
if config(SAMPLE_CONFIG_FILE):
|
if config(SAMPLE_CONFIG_FILE):
|
||||||
migratecfg.migrate()
|
migratecfg.migrate()
|
||||||
|
elif config():
|
||||||
|
shutil.copyfile(CONFIG_FILE, SAMPLE_CONFIG_FILE)
|
||||||
|
migratecfg.migrate()
|
||||||
|
|
||||||
# check to write settings from nzbGet UI to autoProcessMedia.cfg.
|
# check to write settings from nzbGet UI to autoProcessMedia.cfg.
|
||||||
if os.environ.has_key('NZBOP_SCRIPTDIR'):
|
if os.environ.has_key('NZBOP_SCRIPTDIR'):
|
||||||
migratecfg.addnzbget()
|
migratecfg.addnzbget()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue