Skip to content

Commit 5fddc3f

Browse files
committed
Missing plus doesn't solve index error though... re-adding.
1 parent 2b15f17 commit 5fddc3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

custom_components/sensor/plex_recently_added.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,5 +367,9 @@ def get_info(title):
367367
tmdb_url = requests.get('https://api.themoviedb.org/3/search/movie?'
368368
+ 'api_key=1f7708bb9a218ab891a5d438b1b63992&query='
369369
+ title)
370-
tmdb_json = tmdb_url.json()
371-
return tmdb_json['results'][0]['overview']
370+
try:
371+
tmdb_json = tmdb_url.json()['results'][0]['overview']
372+
except:
373+
_LOGGER.warning("Failed to get information from TMDB")
374+
tmdb_json = {}
375+
return tmdb_json

0 commit comments

Comments
 (0)