Fixed TypeError that crashes the addon #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest Version of the Addon crashes every time you try to get any videodata. This change prevents the addon from crashing.
I guess the 4Players api changed and returns other types.
Kodi.log callstack for further information:
"
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: unsupported operand type(s) for /: 'unicode' and 'int'
Traceback (most recent call last):
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 210, in
plugin.run()
File "C:\Users...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 332, in run
items = self._dispatch(self.request.path)
File "C:\Users...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 306, in _dispatch
listitems = view_func(**items)
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 65, in latest_videos
items = __format_videos(videos)
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 166, in __format_videos
} for i, video in enumerate(videos)]
TypeError: unsupported operand type(s) for /: 'unicode' and 'int'
-->End of Python script error report<--
"