dylandoamaral / trakt-integration

A Trakt integration for Home Assistant compatible with upcoming media card
MIT License
32 stars 13 forks source link

Retrying setup: name 'data' is not defined (v0.5.0) #47

Closed SBerg1980 closed 2 years ago

SBerg1980 commented 2 years ago

This error originated from a custom integration.

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/apis/trakt.py:79 Integration: Trakt (documentation, issues) First occurred: 18:47:17 (4 occurrences) Last logged: 18:48:37

Unexpected error fetching trakt data: name 'data' is not defined Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 217, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 175, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 146, in fetch_upcoming raw_medias = await self.fetch_watched(excluded_shows) File "/config/custom_components/trakt_tv/apis/trakt.py", line 79, in fetch_watched ids = data["show"]["ids"] NameError: name 'data' is not defined

SBerg1980 commented 2 years ago

Maybe this is the problem: @trakt We’re looking into the server issues. AWS is having some sort of performance or scaling issue that is affecting all parts of Trakt. 2022-09-30 16:36:57

Fifty889 commented 2 years ago

i had the same error, i corrected line 79 in "custom_components\trakt_tv\apis\trakt.py". now i have the following error:

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/models/media.py:108 Integration: Trakt (documentation, issues) First occurred: 22:26:26 (9 occurrences) Last logged: 22:33:27

Unexpected error fetching trakt data: 'movie' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 217, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 175, in fetch_next_to_watch data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 162, in fetch_upcoming medias = [trakt_kind.value.model.from_trakt(media) for media in raw_medias] File "/config/custom_components/trakt_tv/apis/trakt.py", line 162, in medias = [trakt_kind.value.model.from_trakt(media) for media in raw_medias] File "/config/custom_components/trakt_tv/models/media.py", line 108, in from_trakt movie = data if data.get("title") else data["movie"] KeyError: 'movie'

krysiswbk commented 2 years ago

Same issue here

dylandoamaral commented 2 years ago

It should be fixed by https://github.com/dylandoamaral/trakt-integration/pull/48 in V0.5.1, sorry.