[16] Fixes #2034 `anilist_userlist` `score` attribute wasn't being validated correctly

pull/2053/head
meisnate12 6 months ago
parent aed98d5c3f
commit d0b6b3abc3

@ -12,5 +12,6 @@ Changed the `overlay_artwork_filetype` Setting to accept `webp_lossy` and `webp_
# Defaults # Defaults
# Bug Fixes # Bug Fixes
Fixes #2034 `anilist_userlist` `score` attribute wasn't being validated correctly
Various other Minor Fixes Various other Minor Fixes

@ -1 +1 @@
2.0.1-develop15 2.0.1-develop16

@ -241,7 +241,7 @@ class AniList:
variables = {"user": username, "sort": userlist_sort_options[sort_by]} variables = {"user": username, "sort": userlist_sort_options[sort_by]}
for alist in self._request(query, variables)["data"]["MediaListCollection"]["lists"]: for alist in self._request(query, variables)["data"]["MediaListCollection"]["lists"]:
if alist["name"] == list_name: if alist["name"] == list_name:
return [m["media"]["id"] for m in alist["entries"] if not score or not any([util.is_number_filter(value, mod, m["score"]) for mod, value in score.items()])] return [m["media"]["id"] for m in alist["entries"] if not score or not any([util.is_number_filter(m["score"], mod, value) for mod, value in score.items()])]
return [] return []
def validate_userlist(self, data): def validate_userlist(self, data):

@ -1412,8 +1412,8 @@ class CollectionBuilder:
score_dict = {} score_dict = {}
for search_method, search_data in dict_data.items(): for search_method, search_data in dict_data.items():
search_attr, modifier = os.path.splitext(str(search_method).lower()) search_attr, modifier = os.path.splitext(str(search_method).lower())
if search_attr == "score" and modifier in ["gt", "gte", "lt", "lte"]: if search_attr == "score" and modifier in [".gt", ".gte", ".lt", ".lte"]:
score = util.parse(self.Type, search_method, dict_data, datatype="int", default=-1, minimum=0, maximum=10, parent=method_name) score = util.parse(self.Type, search_method, dict_data, methods=dict_methods, datatype="int", default=-1, minimum=0, maximum=10, parent=method_name)
if score > -1: if score > -1:
score_dict[modifier] = score score_dict[modifier] = score
elif search_attr not in ["username", "list_name", "sort_by"]: elif search_attr not in ["username", "list_name", "sort_by"]:

Loading…
Cancel
Save