diff --git a/nzbtomedia/nzbToMediaConfig.py b/nzbtomedia/nzbToMediaConfig.py index 3a629534..32a4183f 100644 --- a/nzbtomedia/nzbToMediaConfig.py +++ b/nzbtomedia/nzbToMediaConfig.py @@ -42,6 +42,10 @@ class Section(configobj.Section): if not value: del to_return[subsection] + else: + for category in to_return[subsection]: + if category != key: + del to_return[subsection][category] # cleanout empty sections and subsections for key in [k for (k, v) in to_return.items() if not v]: diff --git a/tests/general.py b/tests/general.py index 0f27fc4b..f3463e61 100755 --- a/tests/general.py +++ b/tests/general.py @@ -17,8 +17,10 @@ else: print "FFPROBE FAILED" test = nzbtomedia.CFG['SickBeard','NzbDrone']['tv'].isenabled() +print test section = nzbtomedia.CFG.findsection('tv').isenabled() print section +print len(section) fork, fork_params = autoFork('SickBeard', 'tv') if server_responding("http://127.0.0.1:5050"):