mdhiggins / PlexAutoSkip

Automatically skip content in Plex
MIT License
198 stars 11 forks source link

Recurring error: TypeError: object of type 'Session' has no len() #21

Closed doctarrwho closed 1 year ago

doctarrwho commented 1 year ago

Started seeing this issue a couple of days ago, since getting the latest update for the docker. The error continues to repeat every second. I haven't changed any configuration.

ERROR - Unexpected error getting data from session alert
Traceback (most recent call last):
  File "/usr/local/pas/resources/skipper.py", line 316, in processAlert
    if media and media.session and len(media.session) > 0 and media.session[0].location == 'lan':
TypeError: object of type 'Session' has no len()
doctarrwho commented 1 year ago

Also confirmed that I don't get the error after setting the docker to use an older commit (ghcr.io/mdhiggins/plexautoskip-docker@sha256:553ebda88b91b7e312337b04272b34fc97264fb375e6e5685ef7984ed5470f76).

mdhiggins commented 1 year ago

Looks like PlexAPI updated to 4.12 with some breaking changes regarding sessions

https://github.com/pkkid/python-plexapi/releases/tag/4.12.0

Updated with this which fixes it

17bfbb3651c7bc0aaf763f45f450a3a207716d18

Updating the docker container now, should be ready for a fresh pull in a few minutes

This change will not be backwards compatible with the old versions of PlexAPI hence the updates of requirements.txt as well

doctarrwho commented 1 year ago

Thanks! I'll test with the docker update and report back.

mdhiggins commented 1 year ago

Published as of now, should be good to pull

doctarrwho commented 1 year ago

No more errors after pulling latest. Thanks for the quick fix!

mdhiggins commented 1 year ago

d507033c81c91c8f2c74b9423ae75591fec57eb8

There were some more sneaky errors, one being that the new API wouldn't actually report any markers or chapters when the session was accessed, had to make lots more changes but seems to be working now