Skip to content

Commit

Permalink
Fixes imdb_chart error when using trending_india
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Sep 26, 2024
1 parent 4c5f342 commit 7e586c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Fixes sort order of resolution collections
Fixes #2228 ".any" not accepted for a variety of imdb_search parameters
Fixes `streaming` defaults adding and removing items randomly
Fixes missing TMDb Discover parameters
Fixes `imdb_chart` error when using `trending_india`
Adds error information to help with #2201
Various other Minor Fixes
12 changes: 4 additions & 8 deletions modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,14 +1483,10 @@ def _imdb(self, method_name, method_data):
self.builders.append((method_name, imdb_dict))
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:
raise Failed(f"{self.Type} Error: chart: {value} does not work with show libraries")
elif value in imdb.show_charts and self.library.is_movie:
raise Failed(f"{self.Type} Error: chart: {value} does not work with movie libraries")
elif value in imdb.movie_charts or value in imdb.show_charts:
self.builders.append((method_name, value))
else:
raise Failed(f"{self.Type} Error: chart: {value} is invalid options are {[i for i in imdb.charts]}")
_chart = imdb.movie_charts if self.library.is_movie else imdb.show_charts
if value not in _chart:
raise Failed(f"{self.Type} Error: chart: {value} is invalid options are {', '.join(_chart)}")
self.builders.append((method_name, value))
elif method_name == "imdb_award":
for dict_data in util.parse(self.Type, method_name, method_data, datatype="listdict"):
dict_methods = {dm.lower(): dm for dm in dict_data}
Expand Down

0 comments on commit 7e586c0

Please sign in to comment.