Closed BrutuZ closed 5 months ago
Added a commit to handle (ignore) the odd anonymous Plex sessions. Sometimes when streaming the session won't have a user name, it will look empty even on the server dashboard. Not sure if it's a side-effect of streaming via PlexKodiConnect but regardless, this is the expected behavior instead of raising an exception every few seconds
2024-05-18 01:42:41,239 - ERROR - plex - plex - Weird key error in plex. Resetting status.
Traceback (most recent call last):
File "...\trakt_scrobbler\player_monitors\plex.py", line 120, in update_status
return self._update_status()
^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\player_monitors\plex.py", line 109, in _update_status
status_data = self.get_data(self.session_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\trakt_scrobbler\player_monitors\plex.py", line 105, in get_data
if metadata["User"]["title"] == self.config["scrobble_user"]:
~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'title'
What Happens
trakt-scrobbler silently crashes with the following entry to
remap_rules.toml
:What Should Happen
Parser should gracefully handle a single episode declared as a string.
What changed
Added
TypeError
to the caught exceptions as groups contained in a part of the expression that don't match (m["end"]
) return aNoneType
(docs) which causes theint()
operation fail instead of the mapping.