mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 18:47:09 -07:00
Made some changes to how sections are returned, now with a section counter
This commit is contained in:
parent
45ab861017
commit
640f25895b
5 changed files with 15 additions and 15 deletions
|
@ -15,12 +15,12 @@ class autoProcessComics:
|
|||
return 1 # failure
|
||||
|
||||
# auto-detect correct section
|
||||
section = [x for x in config.issubsection(inputCategory) if int(config()[x][inputCategory]['enabled']) == 1][0]
|
||||
if len(section) > 1:
|
||||
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1]
|
||||
if secCount > 1:
|
||||
Logger.error(
|
||||
"MAIN: You can't have multiple sub-sections with the same name enabled, fix your autoProcessMedia.cfg file.")
|
||||
return 1
|
||||
elif len(section) == 0:
|
||||
elif secCount == 0:
|
||||
Logger.error(
|
||||
"MAIN: We were unable to find a processor for category %s that was enabled, please check your autoProcessMedia.cfg file.", inputCategory)
|
||||
return 1
|
||||
|
|
|
@ -14,12 +14,12 @@ class autoProcessGames:
|
|||
return 1 # failure
|
||||
|
||||
# auto-detect correct section
|
||||
section = [x for x in config.issubsection(inputCategory) if int(config()[x][inputCategory]['enabled']) == 1][0]
|
||||
if len(section) > 1:
|
||||
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1]
|
||||
if secCount > 1:
|
||||
Logger.error(
|
||||
"MAIN: You can't have multiple sub-sections with the same name enabled, fix your autoProcessMedia.cfg file.")
|
||||
return 1
|
||||
elif len(section) == 0:
|
||||
elif secCount == 0:
|
||||
Logger.error(
|
||||
"MAIN: We were unable to find a processor for category %s that was enabled, please check your autoProcessMedia.cfg file.", inputCategory)
|
||||
return 1
|
||||
|
|
|
@ -166,12 +166,12 @@ class autoProcessMovie:
|
|||
return 1 # failure
|
||||
|
||||
# auto-detect correct section
|
||||
section = [x for x in config.issubsection(inputCategory) if int(config()[x][inputCategory]['enabled']) == 1][0]
|
||||
if len(section) > 1:
|
||||
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1]
|
||||
if secCount > 1:
|
||||
Logger.error(
|
||||
"MAIN: You can't have multiple sub-sections with the same name enabled, fix your autoProcessMedia.cfg file.")
|
||||
return 1
|
||||
elif len(section) == 0:
|
||||
elif secCount == 0:
|
||||
Logger.error(
|
||||
"MAIN: We were unable to find a processor for category %s that was enabled, please check your autoProcessMedia.cfg file.", inputCategory)
|
||||
return 1
|
||||
|
|
|
@ -15,12 +15,12 @@ class autoProcessMusic:
|
|||
return 1 # failure
|
||||
|
||||
# auto-detect correct section
|
||||
section = [x for x in config.issubsection(inputCategory) if int(config()[x][inputCategory]['enabled']) == 1][0]
|
||||
if len(section) > 1:
|
||||
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1]
|
||||
if secCount > 1:
|
||||
Logger.error(
|
||||
"MAIN: You can't have multiple sub-sections with the same name enabled, fix your autoProcessMedia.cfg file.")
|
||||
return 1
|
||||
elif len(section) == 0:
|
||||
elif secCount == 0:
|
||||
Logger.error(
|
||||
"MAIN: We were unable to find a processor for category %s that was enabled, please check your autoProcessMedia.cfg file.", inputCategory)
|
||||
return 1
|
||||
|
|
|
@ -20,12 +20,12 @@ class autoProcessTV:
|
|||
return 1 # failure
|
||||
|
||||
# auto-detect correct section
|
||||
section = [x for x in config.issubsection(inputCategory) if int(config()[x][inputCategory]['enabled']) == 1][0]
|
||||
if len(section) > 1:
|
||||
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1]
|
||||
if secCount > 1:
|
||||
Logger.error(
|
||||
"MAIN: You can't have multiple sub-sections with the same name enabled, fix your autoProcessMedia.cfg file.")
|
||||
return 1
|
||||
elif len(section) == 0:
|
||||
elif secCount == 0:
|
||||
Logger.error(
|
||||
"MAIN: We were unable to find a processor for category %s that was enabled, please check your autoProcessMedia.cfg file.", inputCategory)
|
||||
return 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue