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

Prevent excessive library refreshes when browsing libraries in Plex Web (thanks @Spacetech) #2027

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

Spacetech
Copy link

@Spacetech Spacetech commented Feb 29, 2024

Fixes #1997

Whenever users click through shows, episodes, movies, etc in Plex Web, Plex sends activity events to a WebSocket. Plex does this because it's attempting to refresh some data for the item when a user views them. Here is an example of the websocket event that fires after clicking a movie:

308389875-e7597b06-4283-4680-8cb8-ce18508f89ce

Assuming you have PKC background sync enabled, PKC is triggering Kodi library updates when this happens. The logic for processing the websocket message is here

It's not ideal that browsing the library is constantly triggering churn in the database (PKC resyncs the item when this happens) & Kodi library updates.

The websocket message looks like it indicates whether or not it actually refreshed the item (the refreshed) property. I propose that we leverage that and ignore the activity message when it's false.

For me, this issue is causing periodic screen flashing/flickering due to the Kodi skin I'm using, so it's quite annoying.

@croneter croneter changed the title Prevent excessive library refreshes when browsing libraries in Plex Web Prevent excessive library refreshes when browsing libraries in Plex Web (thanks @Spacetech) Mar 1, 2024
@croneter
Copy link
Owner

croneter commented Mar 1, 2024

Really cool, thanks!!

@croneter croneter merged commit e9f271a into croneter:python3-beta Mar 1, 2024
1 check passed
@Spacetech Spacetech deleted the kodi_refreshes branch March 1, 2024 20:30
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

Successfully merging this pull request may close these issues.

Spinning wheel/Screen Refeshing every 5 seconds
2 participants