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,21 +6,25 @@ class migratecfg:
|
|||
def migrate(self):
|
||||
categories = []
|
||||
|
||||
try:
|
||||
# check for autoProcessMedia.cfg and create if it does not exist
|
||||
if not config(config.CONFIG_FILE):
|
||||
shutil.copyfile(config.SAMPLE_CONFIG_FILE, config.CONFIG_FILE)
|
||||
configold = config(config.CONFIG_FILE)
|
||||
except:pass
|
||||
|
||||
try:
|
||||
# check for autoProcessMedia.cfg.sample and create if it does not exist
|
||||
if not config(config.SAMPLE_CONFIG_FILE):
|
||||
shutil.copyfile(config.CONFIG_FILE, 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
|
||||
|
||||
# check for autoProcessMedia.cfg and create if it does not exist
|
||||
if not config(config.CONFIG_FILE):
|
||||
shutil.copyfile(config.SAMPLE_CONFIG_FILE, config.CONFIG_FILE)
|
||||
configold = config(config.CONFIG_FILE)
|
||||
|
||||
# check for autoProcessMedia.cfg.sample and create if it does not exist
|
||||
if not config(config.SAMPLE_CONFIG_FILE):
|
||||
shutil.copyfile(config.CONFIG_FILE, config.SAMPLE_CONFIG_FILE)
|
||||
confignew = config(config.SAMPLE_CONFIG_FILE)
|
||||
|
||||
section = "CouchPotato"
|
||||
section = "CouchPotato"
|
||||
for option, value in configold.items(section) or config(config.MOVIE_CONFIG_FILE).items(section):
|
||||
if option == "category": # change this old format
|
||||
option = "cpsCategory"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue