Open teo-luc opened 4 days ago
I just fixed it by myself by safely accessing the HashMap Please help me update your code if it's needed. Thanks
async def _tracks_to_attribute(self):
self.log_debug_later("[S] _tracks_to_attribute")
await self.async_update_extra_sensor('total_tracks', len(self._tracks))
track_attributes = []
for track in self._tracks:
info = self.extract_info(track)
artistInfo = info['track_artist']
# safely checking the artistInfo
if artistInfo is None:
artistInfo = ""
# safely checking the trackNameInfo
trackNameInfo = info['track_name']
if trackNameInfo is None:
trackNameInfo = ""
track_attributes.append(artistInfo + " - " + artistInfo)
await self.async_update_extra_sensor('tracks', track_attributes) # update extra sensor
# fire event to let media card know to update
event_data = {
"device_id": self._attr_unique_id,
"entity_id": self.entity_id,
"type": "reload_playlist",
}
self.hass.bus.async_fire(DOMAIN+"_event", event_data)
self.log_me('debug', "[E] _tracks_to_attribute")
I was about to report the same issue. Will it be solved with an update or do we manually repair it?
@teo-luc you are most welcome to submit a pull request. But I can copy you fix as well .. let me know
Hi @KoljaWindeler I get an issue while pushing the change.
Pushing to github.com:KoljaWindeler/ytube_music_player.git
ERROR: Permission to KoljaWindeler/ytube_music_player.git denied to teo-luc.
so please help me to update the change by following my fix here.
Thanks a lot 🙌
Dear KoljaWindeler,
Could you please push this solved issue as a new update to the custom component? This would prevent the users from downgrading to the May update again.
Many thanks in advance.
Kind regards,
Robin
hey guys, can you help me to reproduce this bug? what have you done to trigger it?
Your fix might solve it, but it is strange that it is needed in the first place. We're running extract_info to get the data here https://github.com/KoljaWindeler/ytube_music_player/blob/07268c46db24156257c47cb007a5c80bf9c32b35/custom_components/ytube_music_player/media_player.py#L1210 which is setting all the attributes in the first lines https://github.com/KoljaWindeler/ytube_music_player/blob/07268c46db24156257c47cb007a5c80bf9c32b35/custom_components/ytube_music_player/media_player.py#L919
so why is this happening?
I got an exception here after upgrading the HA. Please help me to verify this exception. Thanks a lot
HA Info:
Here is the log: