[43] fix imdb_search limit

pull/1767/head
meisnate12 12 months ago
parent ae3083ed16
commit 0c65d54943

@ -1 +1 @@
1.19.1-develop42 1.19.1-develop43

@ -1616,7 +1616,7 @@ class CollectionBuilder:
elif search_attr == "adult": elif search_attr == "adult":
if util.parse(self.Type, search_method, search_data, datatype="bool", parent=method_name): if util.parse(self.Type, search_method, search_data, datatype="bool", parent=method_name):
new_dictionary[lower_method] = True new_dictionary[lower_method] = True
else: elif search_attr != "limit":
raise Failed(f"{self.Type} Error: {method_name} {search_method} attribute not supported") raise Failed(f"{self.Type} Error: {method_name} {search_method} attribute not supported")
if len(new_dictionary) > 1: if len(new_dictionary) > 1:
self.builders.append((method_name, new_dictionary)) self.builders.append((method_name, new_dictionary))

@ -378,7 +378,7 @@ class IMDb:
logger.ghost("Parsing Page 1") logger.ghost("Parsing Page 1")
response_json = self._graph_request(json_obj) response_json = self._graph_request(json_obj)
total = response_json["data"]["advancedTitleSearch"]["total"] total = response_json["data"]["advancedTitleSearch"]["total"]
limit = data["limit"] if "limit" in data else 0 limit = data["limit"]
if limit < 1 or total < limit: if limit < 1 or total < limit:
limit = total limit = total
remainder = limit % item_count remainder = limit % item_count

Loading…
Cancel
Save