Fixed enable/disable check.

Added few more helper functions to our config class.
This commit is contained in:
echel0n 2014-04-07 06:47:36 -07:00
commit c9898e0e87
14 changed files with 53 additions and 49 deletions

View file

@ -15,12 +15,8 @@ class autoProcessComics:
return 1 # failure
# auto-detect correct section
secCount, section = [x for x in enumerate(config.issubsection(inputCategory)) if int(config()[x[1]][inputCategory]['enabled']) == 1][0]
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 secCount == 0:
section = config.issubsection(inputCategory, checkenabled=True)
if len(section) == 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