[77] oscars fix

pull/1806/head
meisnate12 11 months ago
parent 89c075c82a
commit 82beaebd8c

@ -1 +1 @@
1.19.1-develop76
1.19.1-develop77

@ -54,7 +54,6 @@ collections:
translation_key: golden_director
- name: arr
- name: custom
tmdb_list: 8235502
imdb_award:
event_id: ev0000292
event_year: all

@ -45,6 +45,7 @@ collections:
event_id: ev0000003
event_year: all
category_filter:
- best achievement in directing
- best director
- best director, comedy picture
- best director, dramatic picture

@ -1516,7 +1516,7 @@ class CollectionBuilder:
if not og_year:
raise Failed(f"{self.Type} Error: imdb_award event_year attribute is blank")
if og_year == "all":
event_year = year_options
event_year = "all"
elif not isinstance(og_year, list) and "-" in str(og_year) and len(str(og_year)) > 7:
try:
min_year, max_year = og_year.split("-")
@ -1531,7 +1531,7 @@ class CollectionBuilder:
raise Failed(f"{self.Type} Error: imdb_award event_year attribute invalid: {og_year}")
else:
event_year = util.parse(self.Type, "event_year", og_year, parent=method_name, datatype="strlist", options=year_options)
if len(event_year) > 1 and not git_event:
if (event_year == "all" or len(event_year) > 1) and not git_event:
raise Failed(f"{self.Type} Error: Only specific events work when using multiple years. Event Options: [{', '.join([k for k in self.config.IMDb.events_validation])}]")
award_filters = []
if "award_filter" in dict_methods:

@ -173,7 +173,7 @@ class IMDb:
return self.events_validation[event_id]["awards"], self.events_validation[event_id]["categories"]
award_names = []
category_names = []
event_slug = f"{event_year}/1" if "-" not in event_year else event_year.replace("-", "/")
event_slug = f"{event_year[0]}/1" if "-" not in event_year[0] else event_year[0].replace("-", "/")
for text in self._request(f"{base_url}/event/{event_id}/{event_slug}/?ref_=ev_eh", xpath="//div[@class='article']/script/text()")[0].split("\n"):
if text.strip().startswith("IMDbReactWidgets.NomineesWidget.push"):
jsonline = text.strip()
@ -441,7 +441,8 @@ class IMDb:
final_list = []
if data["event_id"] in self.events_validation:
event_data = self.get_event(data["event_id"])
for event_year in data["event_year"]:
event_years = self.events_validation[data["event_id"]]["years"] if data["event_year"] == "all" else data["event_year"]
for event_year in event_years:
for award, categories in event_data[event_year].items():
if data["award_filter"] and award not in data["award_filter"]:
continue
@ -547,7 +548,7 @@ class IMDb:
logger.info(f"Processing IMDb Watchlist: {data}")
return [(_i, "imdb") for _i in self._watchlist(data, language)]
elif method == "imdb_award":
if len(data["event_year"]) == 1:
if data["event_year"] != "all" and len(data["event_year"]) == 1:
event_slug = f"{data['event_year'][0]}/1" if "-" not in data["event_year"][0] else data["event_year"][0].replace("-", "/")
logger.info(f"Processing IMDb Award: {base_url}/event/{data['event_id']}/{event_slug}/?ref_=ev_eh")
else:

Loading…
Cancel
Save