[18] mdblist update

pull/915/head
meisnate12 2 years ago
parent 7b2078b54f
commit db8f86d073

@ -1 +1 @@
1.17.0-develop17
1.17.0-develop18

@ -1483,7 +1483,7 @@ class CollectionBuilder:
elif "reciperr" in method or "stevenlu" in method:
ids = self.config.Reciperr.get_imdb_ids(method, value)
elif "mdblist" in method:
ids = self.config.Mdblist.get_imdb_ids(method, value)
ids = self.config.Mdblist.get_tmdb_ids(method, value)
elif "tmdb" in method:
ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie, self.tmdb_region)
elif "trakt" in method:

@ -158,8 +158,8 @@ class Mdblist:
sort_by = mdb_dict[dict_methods["sort_by"]].lower()
valid_lists.append({"url": mdb_url, "limit": list_count, "sort_by": sort_by})
return valid_lists
def get_imdb_ids(self, method, data):
def get_tmdb_ids(self, method, data):
if method == "mdblist_list":
logger.info(f"Processing Mdblist.com List: {data['url']}")
logger.info(f"Sort By: {data['sort_by']}")
@ -176,7 +176,11 @@ class Mdblist:
response = self.config.get_json(url_base, headers=headers, params=params)
if "error" in response:
raise Failed(f"Mdblist Error: Invalid Response {response}")
return [(i["imdb_id"], "imdb") for i in response]
results = []
for item in response:
if item["mediatype"] in ["movie", "show"]:
results.append((item["id"], "tmdb" if item["mediatype"] == "movie" else "tmdb_show"))
return results
except JSONDecodeError:
raise Failed(f"Mdblist Error: Invalid Response")
else:

Loading…
Cancel
Save