Skip to content

Add 'Update Plex Libraries' tray menu option - #101

Open
beni-ma-ru wants to merge 1 commit into
cjmurph:masterfrom
beni-ma-ru:feature/update-plex-libraries
Open

Add 'Update Plex Libraries' tray menu option#101
beni-ma-ru wants to merge 1 commit into
cjmurph:masterfrom
beni-ma-ru:feature/update-plex-libraries

Conversation

@beni-ma-ru

Copy link
Copy Markdown

What

Adds an Update Plex Libraries option to the tray icon context menu (shown while Plex is running, below "Restart Plex"). Clicking it asks Plex to scan/update all libraries — the same action as "Update Libraries" in the web UI, and a feature people often miss from running Plex as a regular user app.

How

  • New UpdateAllLibraries() operation on the ITrayInteraction WCF contract.
  • The service (not the tray) makes the request to http://localhost:32400/library/sections/all/refresh, appending the X-Plex-Token read from the registry via the existing PlexRegistryHelper when available. Doing it service-side means the request always originates from the machine hosting Plex, so it also works when the tray app is connected to a remote service instance.
  • The request runs in a background task (same pattern as Start()/Stop()) so the tray's short WCF send timeout isn't at risk; the outcome is written to the service log.
  • The tray shows a "Library update requested" balloon tip after invoking the operation.

Testing

Tested on Windows 11 against a live Plex Media Server 1.43.2 installation running under PmsService:

  • Verified the server rejects the refresh call without a token (401) and accepts it with the registry token (200), confirming the token handling is required and correct.
  • Deployed the rebuilt binaries over an existing 1.2.3 install; service started and restarted Plex normally.
  • Invoked UpdateAllLibraries() over the WCF channel and confirmed the service log shows Update of all libraries requested, plex responded: OK, with the library scan visible in the Plex dashboard.
  • Verified from the tray menu itself: removed a media item from a library folder, clicked Update Plex Libraries, and watched it disappear from Plex; added the file back, updated again, and it reappeared.

Adds a new UpdateAllLibraries operation to the WCF service contract.
The service requests http://localhost:32400/library/sections/all/refresh
(with the X-Plex-Token from the registry when available) so the request
always originates from the machine hosting plex, meaning it also works
when the tray app is connected to a remote service.

The tray context menu shows the new option while plex is running and
confirms the request with a balloon tip.
@beni-ma-ru
beni-ma-ru force-pushed the feature/update-plex-libraries branch from 240be54 to 440a0a0 Compare July 17, 2026 23:16
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.

1 participant