Skip to content

Commit

Permalink
tmdb: skip empty overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and alphatownsman committed Jul 27, 2024
1 parent 532439b commit 9fb44f6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions catalog/sites/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def scrape(self):
api_url = f"https://api.themoviedb.org/3/movie/{self.id_value}?api_key={settings.TMDB_API3_KEY}&language={lang_param}&append_to_response=external_ids,credits"
res_data = BasicDownloader(api_url).download().json()
localized_title.append({"lang": lang, "text": res_data["title"]})
localized_desc.append({"lang": lang, "text": res_data["overview"]})
if res_data.get("overview", "").strip():
localized_desc.append({"lang": lang, "text": res_data["overview"]})
title = res_data["title"]
orig_title = res_data["original_title"]
year = (
Expand Down Expand Up @@ -198,7 +199,8 @@ def scrape(self):
api_url = f"https://api.themoviedb.org/3/tv/{self.id_value}?api_key={settings.TMDB_API3_KEY}&language={lang_param}&append_to_response=external_ids,credits"
res_data = BasicDownloader(api_url).download().json()
localized_title.append({"lang": lang, "text": res_data["name"]})
localized_desc.append({"lang": lang, "text": res_data["overview"]})
if res_data.get("overview", "").strip():
localized_desc.append({"lang": lang, "text": res_data["overview"]})

title = res_data["name"]
orig_title = res_data["original_name"]
Expand Down Expand Up @@ -318,7 +320,8 @@ def scrape(self):
api_url = f"https://api.themoviedb.org/3/tv/{show_id}/season/{season_id}?api_key={settings.TMDB_API3_KEY}&language={lang_param}&append_to_response=external_ids,credits"
res_data = BasicDownloader(api_url).download().json()
localized_title.append({"lang": lang, "text": res_data["name"]})
localized_desc.append({"lang": lang, "text": res_data["overview"]})
if res_data.get("overview", "").strip():
localized_desc.append({"lang": lang, "text": res_data["overview"]})
if not res_data.get("id"):
raise ParseError(self, "id")
d = res_data
Expand Down

0 comments on commit 9fb44f6

Please sign in to comment.