Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing element event_date for upcoming stream results in TypeError #37

Open
cas-- opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@cas--
Copy link
Contributor

cas-- commented Oct 23, 2024

Describe the bug

Last weekend trying to list the WRC event encountered an error:

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This was due to element missing event_date attribute (see pdb_locals)

The quick fix is to fallback with empty string:

-    list_item.setPath('/notify/' + localize(30024), localize(30025), element.get('event_date') + ' (GMT+' + str(timezone / 3600 * -1))
+    list_item.setPath('/notify/' + localize(30024), localize(30025), element.get('event_date', '') + ' (GMT+' + str(timezone / 3600 * -1))

To Reproduce

Steps to reproduce the behavior:

  1. Go to Events -> Upcoming Live Events -> FIA World Rally Championship -> Schedule

Expected behavior

Listing of all scheduled videos for the event, usually one for Friday, Saturday and Sunday.

Additional context

  • Operating system: NixOS
  • Kodi version: 20
  • Addon version: 3.2.2

Log (if available)

Error Type: <class 'TypeError'>
Error Contents: unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
  File "/var/lib/kodi/addons/plugin.video.redbull.tv/resources/lib/addon_entry.py", line 10, in <module>
    run(argv)
  File "/var/lib/kodi/addons/plugin.video.redbull.tv/resources/lib/addon.py", line 221, in run
    plugin.run(params)
  File "/var/lib/kodi/addons/script.module.routing/lib/routing.py", line 130, in run
    self._dispatch(self.path)
  File "/var/lib/kodi/addons/script.module.routing/lib/routing.py", line 141, in _dispatch
    view_func(**kwargs)
  File "/var/lib/kodi/addons/plugin.video.redbull.tv/resources/lib/addon.py", line 120, in browse_collection
    build_menu(redbull.get_collection_url(uid))
  File "/var/lib/kodi/addons/plugin.video.redbull.tv/resources/lib/addon.py", line 165, in build_menu
    list_items.append(generate_list_item(item, PRODUCT))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/kodi/addons/plugin.video.redbull.tv/resources/lib/addon.py", line 194, in generate_list_item
    list_item.setPath('/notify/' + localize(30024), localize(30025), element.get('event_date') + ' (GMT+' + str(timezone / 3600 * -1))
                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
@cas--
Copy link
Contributor Author

cas-- commented Oct 23, 2024

I can provide a more comprehensive fix via PR when I get a bit of free time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant