[25] fix duplicate variable

pull/1288/head
meisnate12 2 years ago
parent 7876bee41b
commit 6d81d34be2

@ -1 +1 @@
1.18.3-develop24 1.18.3-develop25

@ -378,36 +378,36 @@ class DataFile:
if var_key == "value": if var_key == "value":
continue continue
error_text = "" error_text = ""
con_value = "" con_var_value = ""
var_key = replace_var(var_key, [variables, default]) var_key = replace_var(var_key, [variables, default])
var_value = replace_var(var_value, [variables, default]) var_value = replace_var(var_value, [variables, default])
if var_key.endswith(".exists"): if var_key.endswith(".exists"):
con_value = util.parse(self.data_type, var_key, var_value, datatype="bool", default=False) con_var_value = util.parse(self.data_type, var_key, var_value, datatype="bool", default=False)
if con_value: if con_var_value:
if var_key[:-7] not in variables or not variables[var_key[:-7]]: if var_key[:-7] not in variables or not variables[var_key[:-7]]:
error_text = "- does not exist" error_text = "- does not exist"
elif var_key[:-7] in variables and variables[var_key[:-7]]: elif var_key[:-7] in variables and variables[var_key[:-7]]:
error_text = "- exists" error_text = "- exists"
elif var_key.endswith(".not"): elif var_key.endswith(".not"):
if var_key[:-4] in variables: if var_key[:-4] in variables:
con_value = variables[var_key[:-4]] con_var_value = variables[var_key[:-4]]
if isinstance(var_value, list): if isinstance(var_value, list):
if con_value in var_value: if con_var_value in var_value:
error_text = f'in {var_value}' error_text = f'in {var_value}'
elif str(con_value) == str(var_value): elif str(con_var_value) == str(var_value):
error_text = f'is "{var_value}"' error_text = f'is "{var_value}"'
elif var_key in variables or var_key in default: elif var_key in variables or var_key in default:
con_value = variables[var_key] if var_key in variables else default[var_key] con_var_value = variables[var_key] if var_key in variables else default[var_key]
if isinstance(var_value, list): if isinstance(var_value, list):
if con_value not in var_value: if con_var_value not in var_value:
error_text = f'not in {var_value}' error_text = f'not in {var_value}'
elif str(con_value) != str(var_value): elif str(con_var_value) != str(var_value):
error_text = f'is not "{var_value}"' error_text = f'is not "{var_value}"'
else: else:
error_text = " is not a variable provided or a default variable" error_text = " is not a variable provided or a default variable"
if error_text: if error_text:
if con_value: if con_var_value:
error_text = f': "{con_value}" {error_text}' error_text = f': "{con_var_value}" {error_text}'
logger.trace(f'Condition {i} Failed: {var_key}{error_text}') logger.trace(f'Condition {i} Failed: {var_key}{error_text}')
condition_passed = False condition_passed = False
if condition_passed: if condition_passed:

@ -501,7 +501,7 @@ class Operations:
if "Overlay" in [la.tag for la in self.library.item_labels(item)]: if "Overlay" in [la.tag for la in self.library.item_labels(item)]:
logger.info(self.library.edit_tags("label", item, remove_tags="Overlay", do_print=False)) logger.info(self.library.edit_tags("label", item, remove_tags="Overlay", do_print=False))
else: else:
logger.info("Poster | No Reset Image Found") logger.warning("Poster | No Reset Image Found")
item.reload() item.reload()
if self.library.mass_background_update: if self.library.mass_background_update:
@ -528,7 +528,7 @@ class Operations:
self.library.upload_background(item, new_background, url=background_url) self.library.upload_background(item, new_background, url=background_url)
logger.info(f"Background | Reset from {background_location}") logger.info(f"Background | Reset from {background_location}")
else: else:
logger.info(f"Background | No Reset Image Found") logger.warning(f"Background | No Reset Image Found")
item.reload() item.reload()
if self.library.is_show: if self.library.is_show:
@ -567,7 +567,7 @@ class Operations:
if "Overlay" in [la.tag for la in self.library.item_labels(season)]: if "Overlay" in [la.tag for la in self.library.item_labels(season)]:
logger.info(self.library.edit_tags("label", season, remove_tags="Overlay", do_print=False)) logger.info(self.library.edit_tags("label", season, remove_tags="Overlay", do_print=False))
else: else:
logger.info(f"{season.title} Poster | No Reset Image Found") logger.warning(f"{season.title} Poster | No Reset Image Found")
item.reload() item.reload()
if self.library.mass_background_update: if self.library.mass_background_update:
if self.library.mass_background_update == "lock": if self.library.mass_background_update == "lock":
@ -589,7 +589,7 @@ class Operations:
self.library.upload_background(item, season_background, url=background_url) self.library.upload_background(item, season_background, url=background_url)
logger.info(f"{season.title} Background | Reset from {background_location}") logger.info(f"{season.title} Background | Reset from {background_location}")
else: else:
logger.info(f"{season.title} Background | No Reset Image Found") logger.warning(f"{season.title} Background | No Reset Image Found")
tmdb_episodes = {} tmdb_episodes = {}
if season.seasonNumber in tmdb_seasons: if season.seasonNumber in tmdb_seasons:
for episode in tmdb_seasons[season.seasonNumber].episodes: for episode in tmdb_seasons[season.seasonNumber].episodes:
@ -631,7 +631,7 @@ class Operations:
if "Overlay" in [la.tag for la in self.library.item_labels(episode)]: if "Overlay" in [la.tag for la in self.library.item_labels(episode)]:
logger.info(self.library.edit_tags("label", episode, remove_tags="Overlay", do_print=False)) logger.info(self.library.edit_tags("label", episode, remove_tags="Overlay", do_print=False))
else: else:
logger.info(f"{episode.title} Poster | No Reset Image Found") logger.warning(f"{episode.title} Poster | No Reset Image Found")
item.reload() item.reload()
if self.library.mass_background_update: if self.library.mass_background_update:
if self.library.mass_background_update == "lock": if self.library.mass_background_update == "lock":
@ -653,7 +653,7 @@ class Operations:
self.library.upload_background(item, episode_background, url=background_url) self.library.upload_background(item, episode_background, url=background_url)
logger.info(f"{episode.title} Background | Reset from {background_location}") logger.info(f"{episode.title} Background | Reset from {background_location}")
else: else:
logger.info(f"{episode.title} Background | No Reset Image Found") logger.warning(f"{episode.title} Background | No Reset Image Found")
item.reload() item.reload()
episode_ops = [self.library.mass_episode_audience_rating_update, self.library.mass_episode_critic_rating_update, self.library.mass_episode_user_rating_update] episode_ops = [self.library.mass_episode_audience_rating_update, self.library.mass_episode_critic_rating_update, self.library.mass_episode_user_rating_update]

Loading…
Cancel
Save