EthanC / Perplex

Discord Rich Presence implementation for Plex.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetch session info from specific user

alecaputo13 opened this issue · comments

I have another enanchment feature to request. I have my own Plex server where i invited many friends. If any of them is watching something on my server the script detects the watching status as if I was watching it.
It would be cool if we could choose for which user fetching session to.

commented

This is a limitation that I'm aware of, but I have yet to find a comfortable solution for it. The Movie and Episode classes in pkkid/python-plexapi do not appear to have any ability to discern which user (name or id) is responsible for the session.

For anybody looking to contribute this Issue, there are two theoretical solutions - the first of which would be preferred:

  1. Add an array to config.json, similar to the servers array, and prioritize sessions from users in this list.
  2. First, prompt the user to choose one of the active sessions if there are multiple. Then save a unique identifier of the user responsible for the session and use it for subsequent updates.

I don't know if this can help but there's an old script like this which had an option called 'listen for user' https://github.com/Phineas05/discord-rich-presence-plex

commented

Nice! It seems that pkkid/python-plexapi doesn't explicitly expose the usernames array anywhere, but it does exist.

I've added a users field to the config, just enter Plex usernames in there and Perplex will use the first one that it finds active.