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

Key error on watchedepisodes #62

Open
romainhild opened this issue Aug 30, 2021 · 2 comments
Open

Key error on watchedepisodes #62

romainhild opened this issue Aug 30, 2021 · 2 comments

Comments

@romainhild
Copy link

Hi, I have an error when accessing the list of episodes of a tv show.
I use OSMC on a raspberry 4, with the aeon silvio skin. The error on the logs are the following:

2021-08-30 13:26:27.513 T:29303    INFO <general>: CPythonInvoker(30, /home/osmc/.kodi/addons/script.embuary.helper/plugin.py): script successfully run
2021-08-30 13:26:27.514 T:29306    INFO <general>: initializing python engine.
2021-08-30 13:26:27.738 T:29303    INFO <general>: Python interpreter stopped
2021-08-30 13:26:27.986 T:29304   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'watchedepisodes'
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/plugin.py", line 70, in <module>
                                                       Main()
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/plugin.py", line 21, in __init__
                                                       self.getinfos()
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/plugin.py", line 54, in getinfos
                                                       self._execute(plugin,self.info)
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/plugin.py", line 62, in _execute
                                                       getattr(plugin,action.lower())()
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/resources/lib/plugin_content.py", line 109, in getbydbid
                                                       add_items(self.li,[result],type=self.dbtype)
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/resources/lib/library.py", line 21, in add_items
                                                       handle_seasons(li, item)
                                                     File "/home/osmc/.kodi/addons/script.embuary.helper/resources/lib/library.py", line 176, in handle_seasons
                                                       watchedepisodes = item['watchedepisodes']
                                                   KeyError: 'watchedepisodes'
                                                   -->End of Python script error report<--
@123Venom
Copy link

same exact error here on Windows 10 running 19.2

@123Venom
Copy link

I've logged the value of item and it appears watchedepisodes is not in the dict. Temp fix for now I've added a try/except

try: watchedepisodes = item['watchedepisodes']
except: watchedepisodes = 0

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

2 participants