Skip to content

Commit 8956e0c

Browse files
authored
Removing TMDB overview search for now, need to rework
1 parent 7840f1f commit 8956e0c

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

custom_components/sensor/plex_recently_added.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_SSL
1919
from homeassistant.helpers.entity import Entity
2020

21-
__version__ = '0.1.8'
21+
__version__ = '0.1.9'
2222

2323
_LOGGER = logging.getLogger(__name__)
2424

@@ -215,7 +215,6 @@ def update(self):
215215
pass
216216
self.api_json = sorted(self.api_json, key=lambda i: i['addedAt'],
217217
reverse=True)[:self.max_items]
218-
overview = get_info(self.api_json[0].get('title', ''))
219218

220219
"""Update attributes if view count changes"""
221220
if view_count(self.api_json) != view_count(self.data):
@@ -361,15 +360,3 @@ def view_count(data):
361360
else:
362361
continue
363362
return ids
364-
365-
366-
def get_info(title):
367-
tmdb_url = requests.get('https://api.themoviedb.org/3/search/movie?'
368-
+ 'api_key=1f7708bb9a218ab891a5d438b1b63992&query='
369-
+ title)
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)