fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
553 stars 101 forks source link

Can't browse clips using Media Browser: TypeError: 'NoneType' object is not iterable #590

Open jus101 opened 1 year ago

jus101 commented 1 year ago

Hi,

I'm using a RLN8-410 NVR with a few cameras attached. When browsing the HA Media Browser, I hit an 'Unknown error' when entering a folder that contains clips:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/reolink_dev/media_source.py:299
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:25:51 AM (3 occurrences)
Last logged: 9:27:08 AM

[547508229632] Error handling message: Unknown error (unknown_error) from 192.168.1.210 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36)
[547280506304] Error handling message: Unknown error (unknown_error) from 192.168.1.210 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36)
[547287777728] Error handling message: Unknown error (unknown_error) from 192.168.1.210 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 170, in websocket_browse_media
    media = await async_browse_media(hass, msg.get("media_content_id", ""))
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 121, in async_browse_media
    item = await _get_media_item(hass, media_content_id, None).async_browse()
  File "/usr/src/homeassistant/homeassistant/components/media_source/models.py", line 79, in async_browse
    return await self.async_media_source().async_browse_media(self)
  File "/config/custom_components/reolink_dev/media_source.py", line 161, in async_browse_media
    return await self._async_browse_media(source, camera_id, event_id, base)
  File "/config/custom_components/reolink_dev/media_source.py", line 336, in _async_browse_media
    media.children = await create_vod_children()
  File "/config/custom_components/reolink_dev/media_source.py", line 299, in create_vod_children
    for file in files:
TypeError: 'NoneType' object is not iterable

I can see all of the folders for each camera/date, but just no clips.