mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Fixed bug in migrate
This commit is contained in:
parent
758c718d57
commit
6ddec2be3b
1 changed files with 56 additions and 51 deletions
|
@ -40,71 +40,76 @@ def migrate():
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
for section in configold.sections():
|
for section in configold.sections():
|
||||||
if section == "HeadPhones":
|
try:
|
||||||
if option in ["username", "password" ]:
|
for option, value in configold.items(section):
|
||||||
continue
|
if section == "HeadPhones":
|
||||||
if option == "hpCategory":
|
if option in ["username", "password" ]:
|
||||||
categories.extend(value.split(','))
|
continue
|
||||||
confignew.set(section, option, value)
|
if option == "hpCategory":
|
||||||
|
categories.extend(value.split(','))
|
||||||
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "Mylar":
|
if section == "Mylar":
|
||||||
if option in "mlCategory":
|
if option in "mlCategory":
|
||||||
categories.extend(value.split(','))
|
categories.extend(value.split(','))
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "Gamez":
|
if section == "Gamez":
|
||||||
if option in ["username", "password" ]: # these are no-longer needed.
|
if option in ["username", "password" ]: # these are no-longer needed.
|
||||||
continue
|
continue
|
||||||
if option == "gzCategory":
|
if option == "gzCategory":
|
||||||
categories.extend(value.split(','))
|
categories.extend(value.split(','))
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "Torrent":
|
if section == "Torrent":
|
||||||
if option in ["compressedExtensions", "mediaExtensions", "metaExtensions", "minSampleSize"]:
|
if option in ["compressedExtensions", "mediaExtensions", "metaExtensions", "minSampleSize"]:
|
||||||
section = "Extensions" # these were moved
|
section = "Extensions" # these were moved
|
||||||
if option == "useLink": # Sym links supported now as well.
|
if option == "useLink": # Sym links supported now as well.
|
||||||
num_value = int(value or 0)
|
if isinstance(value, int):
|
||||||
if num_value == 1:
|
num_value = int(value)
|
||||||
value = "hard"
|
if num_value == 1:
|
||||||
else:
|
value = "hard"
|
||||||
value = "no"
|
else:
|
||||||
confignew.set(section, option, value)
|
value = "no"
|
||||||
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "Extensions":
|
if section == "Extensions":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "Transcoder":
|
if section == "Transcoder":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "WakeOnLan":
|
if section == "WakeOnLan":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "UserScript":
|
if section == "UserScript":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "ASCII":
|
if section == "ASCII":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "passwords":
|
if section == "passwords":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "loggers":
|
if section == "loggers":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "handlers":
|
if section == "handlers":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "formatters":
|
if section == "formatters":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "logger_root":
|
if section == "logger_root":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "handler_console":
|
if section == "handler_console":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
|
||||||
if section == "formatter_generic":
|
if section == "formatter_generic":
|
||||||
confignew.set(section, option, value)
|
confignew.set(section, option, value)
|
||||||
|
except config.InterpolationMissingOptionError:
|
||||||
|
pass
|
||||||
|
|
||||||
for section in categories:
|
for section in categories:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue