test attribute now works with templates

pull/50/head
meisnate12 4 years ago
parent 99b7bc55aa
commit 6958d3c897

@ -29,8 +29,7 @@ class CollectionBuilder:
elif not data["template"]:
raise Failed("Collection Error: template attribute is blank")
else:
template_list = data["template"] if isinstance(data["template"], list) else [data["template"]]
for data_template in template_list:
for data_template in util.get_list(data["template"], split=False):
if not isinstance(data_template, dict):
raise Failed("Collection Error: template attribute is not a dictionary")
elif "name" not in data_template:

@ -348,7 +348,19 @@ class Config:
movie_map, show_map = self.map_guids(library)
for c in collections:
if test and ("test" not in collections[c] or collections[c]["test"] is not True):
continue
no_template_test = True
if "template" in collections[c] and collections[c]["template"]:
for data_template in util.get_list(collections[c]["template"], split=False):
if "name" in data_template \
and data_template["name"] \
and library.templates \
and data_template["name"] in self.library.templates \
and self.library.templates[data_template["name"]] \
and "test" in self.library.templates[data_template["name"]] \
and self.library.templates[data_template["name"]]["test"] == True:
no_template_test = False
if no_template_test:
continue
try:
logger.info("")
util.seperator("{} Collection".format(c))

Loading…
Cancel
Save