dylandoamaral / trakt-integration

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

Time data does not match format. #36

Closed TNTPro closed 2 years ago

TNTPro commented 2 years ago

Hi,

Firstly, thanks for the integration. Latest update give me an error:

This error originated from a custom integration.

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/models/media.py:111 Integration: Trakt (documentation, issues) First occurred: 20:50:50 (5 occurrences) Last logged: 20:52:10

Unexpected error fetching trakt data: time data '2022-05-14' does not match format '%Y-%m-%dT%H:%M:%S.%fZ' Unexpected error fetching trakt data: time data '2022-05-17' does not match format '%Y-%m-%dT%H:%M:%S.%fZ' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 145, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 110, in fetch_upcomings data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 103, 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 103, in medias = [trakt_kind.value.model.from_trakt(media) for media in raw_medias] File "/config/custom_components/trakt_tv/models/media.py", line 111, in from_trakt datetime.strptime(data["released"], UPCOMING_DATA_FORMAT) File "/usr/local/lib/python3.9/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/local/lib/python3.9/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '2022-05-14' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

I didn't notice this on previous version.

mimuncito commented 2 years ago

I have exactly the same problem.

Amerigo1973 commented 2 years ago

Trouble Trakt

dylandoamaral commented 2 years ago

I will fix it ASAP

dylandoamaral commented 2 years ago

Release 0.3.4 should fix the issue.

TNTPro commented 2 years ago

Thanks for the prompt fix. Unfortunately, I now have a new error.

This error originated from a custom integration.

Logger: custom_components.trakt_tv Source: custom_components/trakt_tv/models/media.py:115 Integration: Trakt (documentation, issues) First occurred: 17:49:34 (5 occurrences) Last logged: 17:50:53

Unexpected error fetching trakt data: 'title' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data return await self.update_method() File "/config/custom_components/trakt_tv/apis/trakt.py", line 145, in retrieve_data data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 110, in fetch_upcomings data = await gather( File "/config/custom_components/trakt_tv/apis/trakt.py", line 103, 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 103, in medias = [trakt_kind.value.model.from_trakt(media) for media in raw_medias] File "/config/custom_components/trakt_tv/models/media.py", line 115, in from_trakt name=movie["title"], KeyError: 'title'