mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 22:03:13 -07:00
Fixed config checking code in migratecfg
This commit is contained in:
parent
52e7aa2320
commit
975e1c7567
1 changed files with 15 additions and 11 deletions
|
@ -6,19 +6,23 @@ class migratecfg:
|
||||||
def migrate(self):
|
def migrate(self):
|
||||||
categories = []
|
categories = []
|
||||||
|
|
||||||
# check for autoProcessMedia.cfg and autoProcessMedia.cfg.sample and if they don't exist return and fail
|
try:
|
||||||
if not config() and not config(config.SAMPLE_CONFIG_FILE):
|
|
||||||
return False
|
|
||||||
|
|
||||||
# check for autoProcessMedia.cfg and create if it does not exist
|
# check for autoProcessMedia.cfg and create if it does not exist
|
||||||
if not config(config.CONFIG_FILE):
|
if not config(config.CONFIG_FILE):
|
||||||
shutil.copyfile(config.SAMPLE_CONFIG_FILE, config.CONFIG_FILE)
|
shutil.copyfile(config.SAMPLE_CONFIG_FILE, config.CONFIG_FILE)
|
||||||
configold = config(config.CONFIG_FILE)
|
configold = config(config.CONFIG_FILE)
|
||||||
|
except:pass
|
||||||
|
|
||||||
|
try:
|
||||||
# check for autoProcessMedia.cfg.sample and create if it does not exist
|
# check for autoProcessMedia.cfg.sample and create if it does not exist
|
||||||
if not config(config.SAMPLE_CONFIG_FILE):
|
if not config(config.SAMPLE_CONFIG_FILE):
|
||||||
shutil.copyfile(config.CONFIG_FILE, config.SAMPLE_CONFIG_FILE)
|
shutil.copyfile(config.CONFIG_FILE, config.SAMPLE_CONFIG_FILE)
|
||||||
confignew = config(config.SAMPLE_CONFIG_FILE)
|
confignew = config(config.SAMPLE_CONFIG_FILE)
|
||||||
|
except:pass
|
||||||
|
|
||||||
|
# check for autoProcessMedia.cfg and autoProcessMedia.cfg.sample and if they don't exist return and fail
|
||||||
|
if not config() and not config(config.SAMPLE_CONFIG_FILE):
|
||||||
|
return False
|
||||||
|
|
||||||
section = "CouchPotato"
|
section = "CouchPotato"
|
||||||
for option, value in configold.items(section) or config(config.MOVIE_CONFIG_FILE).items(section):
|
for option, value in configold.items(section) or config(config.MOVIE_CONFIG_FILE).items(section):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue