custom-components / sensor.radarr_upcoming_media

🎬 Radarr component to feed Upcoming Media Card.
Apache License 2.0
59 stars 24 forks source link

radarr_upcoming_media: Error on device update #10

Closed Reznorzo closed 4 years ago

Reznorzo commented 4 years ago

Describe the Bug sensor not showing in states - radarr_upcoming_media: Error on device update

The Error Traceback (most recent call last): File "/config/custom_components/radarr_upcoming_media/sensor.py", line 183, in update '780', tmdb_json['backdrop_path']) IndexError: list assignment index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/radarr_upcoming_media/sensor.py", line 185, in update movie['images'][1] = '' IndexError: list assignment index out of range

Indicate if you followed all steps in the troubleshooting doc All steps followed

What data does the sensor display if any? Sensor is not displayed in states

What displays when visiting the API URL from the troubleshooting guide? When visiting API URL info is displayed correctly

Does the default Home Assistant Radarr component work for you? Yes, default component works

Home Assistant Version 0.104.3

Additional Context `` radarr_issue

dfiorenza commented 4 years ago

Same error here. Any update/fix?

dfiorenza commented 4 years ago

For anyone else with this issue, edit /config/custom_components/radarr_upcoming_media/sensor.py Go to line 182 and remove this entire section

 try:
                        movie['images'][1] = image_url % (
                            '780', tmdb_json['backdrop_path'])
                    except:
                        movie['images'][1] = ''

Reboot home assistant so it reads the configuration and it will work

maykar commented 4 years ago

This fix will only work if you do not use fanart view. I would be interested in knowing what movie is causing this issue as it would help me track it down. If you could share the results from a direct connection to the radarr api and the sensor's data from HA it would be helpful. If you're more comfortable sending this to me via PM on the HA forums, don't hesitate to do so. My username over there is mayker with an e instead of the last a I use here.

maykar commented 4 years ago

Could be as simple as a movie just not having a backdrop file, in which case something like this would do it:

                    try:
                        movie['images'][1] = image_url % (
                            '780', tmdb_json['backdrop_path'])
                    except:
                        pass
dfiorenza commented 4 years ago

That looks to work as well

maykar commented 4 years ago

Try latest release, if that does it you can safely close this issue

TheDave1022 commented 4 years ago

Fix works for me. I cant close this since I'm not the ticket owner