trakt / script.trakt

Trakt.tv movie and TV show scrobbler for Kodi
GNU General Public License v2.0
320 stars 149 forks source link

Error during playback started scrobble causes Trakt to sign out #617

Open kvanzuijlen opened 1 year ago

kvanzuijlen commented 1 year ago

Expected Behavior

Trakt should stay signed in, even when an error occurs. Not sure why in this instance result['episode'] is None.

Current Behavior

The following gets logged by Trakt:

2023-04-17 13:42:09.729 T:117610018 critical <general>: [script.trakt] resources.lib.service: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
  - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
  Error Type: <type 'TypeError'>
  Error Contents: ("'NoneType' object is not subscriptable",)
  Traceback (most recent call last):
   File "/Users/kvanzuijlen/Library/Application Support/Kodi/addons/script.trakt/resources/lib/service.py", line 44, in _dispatch
     self.scrobbler.playbackStarted(data)
   File "/Users/kvanzuijlen/Library/Application Support/Kodi/addons/script.trakt/resources/lib/scrobbler.py", line 288, in playbackStarted
     result['episode']['episodeid'] = self.curVideo['id']
     ~~~~~~^^^^^^^^^^^
  TypeError: 'NoneType' object is not subscriptable
  -->End of Python script error report<--

Followed by:

2023-04-17 13:42:31.890 T:118870094 warning <general>: OutputPicture - timeout waiting for buffer
2023-04-17 13:42:32.808 T:117610018    info <general>: [script.trakt] trakt.core.http: OAuth - Current username is not available ("username" parameter hasn't been defined)
2023-04-17 13:42:32.808 T:117610018    info <general>: [script.trakt] trakt.core.http: OAuth - Token has expired, refreshing token...
2023-04-17 13:42:33.392 T:117610018 warning <general>: [script.trakt] trakt.core.http: OAuth - Unable to refresh expired token (code: 400)
2023-04-17 13:42:33.393 T:117610018 warning <general>: [script.trakt] trakt.interfaces.base: Request failed (no response returned)

Even though I just signed in a couple of minutes ago.

Possible Solution

Steps to Reproduce (for bugs)

Not sure yet, I'll try to update this issue when I know how to reproduce this bug.

Context

Your Environment