Heckie75 / kodi-addon-podcast

Subscribe to podcasts in KODI
MIT License
14 stars 3 forks source link

UnboundLocalError: local variable 'li' referenced before assignment #18

Closed RigacciOrg closed 1 year ago

RigacciOrg commented 1 year ago

It seems related to issue #5, using a perhaps bad RSS feed I get the following into Kodi log:

File "/home/kodi/.kodi/addons/plugin.audio.podcasts/resources/lib/rssaddon/abstract_rss_addon.py",
    line 50, in handle
      self.render_rss(path, url, limit=limit, offset=offset)
File "/home/kodi/.kodi/addons/plugin.audio.podcasts/resources/lib/rssaddon/abstract_rss_addon.py",
    line 300, in render_rss
      if li and "setDateTime" in dir(li):  # available since Kodi v20
    UnboundLocalError: local variable 'li' referenced before assignment
    -->End of Python script error report<--

The feed's URL was manually added in Group 1 of plugin settings: https://www.radioradicale.it/rubriche/61/media-e-dintorni/feed The current XML RSS file is attached: feed.xml.zip

Using plugin.audio.podcasts-2.2.2.zip on Kodi 19.4, Raspberry Pi OS based on Debian 11 Bullseye.

Heckie75 commented 1 year ago

Thanks for your feedback. I guess that I have fixed this problem already, see https://github.com/Heckie75/kodi-submodule-rssaddon/commit/caa418c0594a954c6bb12a017da8e98789c6459a

The problem occurs in case that the feed doesn't have any items.

I haven't published this fix. I going to commit it and prepare PR the next days.

Heckie75 commented 1 year ago

@RigacciOrg Could you please test if the version plugin.audio.podcasts.2.2.3.zip solves the problem?

RigacciOrg commented 1 year ago

I confirm that the issue is solved in version 2.2.3. Thank you and sorry for the delay.