[96] update variable names

pull/753/head
meisnate12 3 years ago
parent ddfec0213f
commit b288472e72

@ -1 +1 @@
1.15.1-develop95 1.15.1-develop96

@ -293,8 +293,8 @@ class MetadataFile(DataFile):
raise Failed(f"Config Error: {map_name} data attribute not found") raise Failed(f"Config Error: {map_name} data attribute not found")
actor_methods = {am.lower(): am for am in actor_data} actor_methods = {am.lower(): am for am in actor_data}
actor_depth = util.parse("Config", "actor_depth", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=3, minimum=1) actor_depth = util.parse("Config", "actor_depth", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=3, minimum=1)
actor_minimum = util.parse("Config", "actor_minimum", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=3, minimum=1) if "actor_minimum" else None actor_minimum = util.parse("Config", "actor_minimum", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=3, minimum=1) if "actor_minimum" in actor_methods else None
number_of_actors = util.parse("Config", "number_of_actors", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=25, minimum=1) if "number_of_actors" else None number_of_actors = util.parse("Config", "number_of_actors", actor_data, parent=f"{map_name} data", methods=actor_methods, datatype="int", default=25, minimum=1) if "number_of_actors" in actor_methods else None
if not actor_minimum and not number_of_actors: if not actor_minimum and not number_of_actors:
actor_minimum = 3 actor_minimum = 3
if not all_items: if not all_items:
@ -312,7 +312,9 @@ class MetadataFile(DataFile):
roles.sort(key=operator.itemgetter('count'), reverse=True) roles.sort(key=operator.itemgetter('count'), reverse=True)
actor_count = 0 actor_count = 0
for role in roles: for role in roles:
if role["name"] not in exclude and ((number_of_actors and actor_count < number_of_actors) or (actor_minimum and role["count"] >= actor_minimum)): if (number_of_actors and actor_count >= number_of_actors) or (actor_minimum and role["count"] < actor_minimum):
break
if role["name"] not in exclude:
try: try:
results = self.config.TMDb.search_people(role["name"]) results = self.config.TMDb.search_people(role["name"])
auto_list[results[0].id] = results[0].name auto_list[results[0].id] = results[0].name
@ -337,8 +339,8 @@ class MetadataFile(DataFile):
if "<<title>>" not in title_format: if "<<title>>" not in title_format:
logger.error(f"Config Error: <<title>> not in title_format: {title_format} using default: {default_title_format}") logger.error(f"Config Error: <<title>> not in title_format: {title_format} using default: {default_title_format}")
title_format = default_title_format title_format = default_title_format
titles = util.parse("Config", "titles", dynamic, parent=map_name, methods=methods, datatype="dict") if "titles" in methods else {} title_override = util.parse("Config", "title_override", dynamic, parent=map_name, methods=methods, datatype="dict") if "title_override" in methods else {}
keys = util.parse("Config", "keys", dynamic, parent=map_name, methods=methods, datatype="dict") if "keys" in methods else {} key_override = util.parse("Config", "key_override", dynamic, parent=map_name, methods=methods, datatype="dict") if "key_override" in methods else {}
test = util.parse("Config", "test", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "test" in methods else False test = util.parse("Config", "test", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "test" in methods else False
sync = util.parse("Config", "sync", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "sync" in methods else False sync = util.parse("Config", "sync", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "sync" in methods else False
if "<<library_type>>" in title_format: if "<<library_type>>" in title_format:
@ -367,11 +369,11 @@ class MetadataFile(DataFile):
for k, v in dictionary_variables.items(): for k, v in dictionary_variables.items():
if key in v: if key in v:
template_call[k] = v[key] template_call[k] = v[key]
if key in titles: if key in title_override:
collection_title = titles[key] collection_title = title_override[key]
else: else:
if key in keys: if key in key_override:
value = keys[key] value = key_override[key]
else: else:
for prefix in remove_prefix: for prefix in remove_prefix:
if value.startswith(prefix): if value.startswith(prefix):

Loading…
Cancel
Save