From 1e47bdd278ed8d85a4bc4f5a4775aa269f8f84c4 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 28 Dec 2023 14:55:46 -0500 Subject: [PATCH] [63] small fixes --- VERSION | 2 +- modules/builder.py | 7 +++++-- modules/config.py | 2 +- modules/imdb.py | 11 +++++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index b55a0336..fb0ae48d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.1-develop62 +1.19.1-develop63 diff --git a/modules/builder.py b/modules/builder.py index 8507bcc6..5b65d508 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1486,8 +1486,11 @@ class CollectionBuilder: raise Failed(f"{self.Type} Error: imdb_id {value} must begin with tt") elif method_name == "imdb_list": logger.warning(f"{self.Type} Warning: imdb_list has been deprecated, and at some point may no longer work. Please switch to using imdb_search.") - for imdb_dict in self.config.IMDb.validate_imdb_lists(self.Type, method_data, self.language): - self.builders.append((method_name, imdb_dict)) + try: + for imdb_dict in self.config.IMDb.validate_imdb_lists(self.Type, method_data, self.language): + self.builders.append((method_name, imdb_dict)) + except Failed as e: + logger.error(e) elif method_name == "imdb_chart": for value in util.get_list(method_data): if value in imdb.movie_charts and not self.library.is_movie: diff --git a/modules/config.py b/modules/config.py index f652c1cf..19bac4c9 100644 --- a/modules/config.py +++ b/modules/config.py @@ -863,7 +863,7 @@ class ConfigFile: elif old_value == new_value: logger.warning(f"Config Warning: {op} value '{new_value}' ignored as it cannot be mapped to itself") else: - params[op][old_value] = new_value if new_value else None + params[op][str(old_value)] = str(new_value) if new_value else None if op == "delete_collections": params[op] = { "managed": check_for_attribute(input_dict, "managed", var_type="bool", default_is_none=True, save=False), diff --git a/modules/imdb.py b/modules/imdb.py index f8ab9969..919187b6 100644 --- a/modules/imdb.py +++ b/modules/imdb.py @@ -20,10 +20,11 @@ charts = { } imdb_search_attributes = [ "limit", "sort_by", "title", "type", "type.not", "release.after", "release.before", "rating.gte", "rating.lte", - "votes.gte", "votes.lte", "genre", "genre.any", "genre.not", "event", "event.winning", "series", "series.not", - "imdb_top", "imdb_bottom", "company", "content_rating", "country", "country.any", "country.not", "country.origin", - "keyword", "keyword.any", "keyword.not", "language", "language.any", "language.not", "language.primary", - "popularity.gte", "popularity.lte", "cast", "cast.any", "cast.not", "runtime.gte", "runtime.lte", "adult", + "votes.gte", "votes.lte", "genre", "genre.any", "genre.not", "event", "event.winning", "imdb_top", "imdb_bottom", + "company", "content_rating", "country", "country.any", "country.not", "country.origin", "keyword", "keyword.any", + "keyword.not", "series", "series.not", "list", "list.any", "list.not", "language", "language.any", "language.not", + "language.primary", "popularity.gte", "popularity.lte", "cast", "cast.any", "cast.not", "runtime.gte", + "runtime.lte", "adult", ] sort_by_options = { "popularity": "POPULARITY", @@ -108,6 +109,8 @@ class IMDb: raise Failed(f"{err_type} Error: imdb_list url attribute is blank") else: imdb_url = imdb_dict[dict_methods["url"]].strip() + if imdb_url.startswith("https://www.imdb.com/search/title/"): + raise Failed("IMDb Error: IMDb URLs with https://www.imdb.com/search/title/ no longer work with imdb_list.") if not imdb_url.startswith(tuple([v for k, v in urls.items()])): fails = "\n ".join([f"{v} (For {k.replace('_', ' ').title()})" for k, v in urls.items()]) raise Failed(f"IMDb Error: {imdb_url} must begin with either:\n {fails}")