From db8f86d0736a3851265aafb0d3147ee28abb3de3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 3 Jun 2022 01:51:16 -0400 Subject: [PATCH] [18] mdblist update --- VERSION | 2 +- modules/builder.py | 2 +- modules/mdblist.py | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 0e6595b9..7b33e1b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.0-develop17 +1.17.0-develop18 diff --git a/modules/builder.py b/modules/builder.py index 589bd947..46400592 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -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: diff --git a/modules/mdblist.py b/modules/mdblist.py index 973ccdd2..497ad0d9 100644 --- a/modules/mdblist.py +++ b/modules/mdblist.py @@ -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: