The following could be most useful for very old libraries, which had their metadata agent already changed several times.
For instance if the server admin has manually selected different posters on many items, but now wants to make a clean break and leave all poster selections to the agent.
While one could do that by deleting the library and re-creating it, it might however be a bit drastic a measure.
What it does:
reset the locked
attribute of all poster selections in a given library. Upon the next Metadata Refresh, the poster of each item will be set to whatever the Plex metadata agent will select as most appropriate.
This method is using the Plex server API, which might be safer than editing the server database file directly.
Preparation:
-
You need access to the
curl
command or have an equivalent way of sending commands per http to your server. (There is also a Windows version ofcurl
available.) -
Determine the library ID number of your Plex library.
You can get it from the Plex XML info of one of this libraryâs items (or by simply hovering the mouse cursor over the library name of this library in the web app) -
Get a valid X-Plex-Token
https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/ -
Build yourself some queries:
(Unlocking the thumbnails for movies, tv shows, tv show seasons, tv shows episodes need to be done separately.
This is thetype
parameter in these lines.)
Execution
Each line will unlock the thumbnail selections of all items in a library of a certain type at once.
curl -X PUT "me.local:32400/library/sections/NN/all?type=1&thumb.locked=0&X-Plex-Token=XXXXX"
curl -X PUT "me.local:32400/library/sections/NN/all?type=2&thumb.locked=0&X-Plex-Token=XXXXX"
curl -X PUT "me.local:32400/library/sections/NN/all?type=3&thumb.locked=0&X-Plex-Token=XXXXX"
curl -X PUT "me.local:32400/library/sections/NN/all?type=4&thumb.locked=0&X-Plex-Token=XXXXX"
- replace
me.local
by the IP address or the domain name of your Plex server - replace NN by the library ID of your music library
- replace XXXXX with your X-Plex-Token
The following is a reference list of item types to be used with the type
parameter.
(Not all of these types are actually used in Plex!)
âMovieâ : 1, âShowâ : 2, âSeasonâ : 3, âEpisodeâ : 4, âTrailerâ : 5, âComicâ : 6, âPersonâ : 7, âArtistâ : 8, âAlbumâ : 9, âTrackâ : 10, âClipâ : 12, âPhotoâ : 13, âPhoto_Albumâ : 14, âPlaylistâ : 15, âPlaylist_Folderâ : 16, âPodcastâ : 17
(shamelessly copied from the old WebTools source code)
Caution: with large libraries and/or slower servers, it can take several minutes to execute these commands. Donât get impatient and leave your server undisturbed while it chews through your libraryâs items.
What it does NOT do:
You could change the query and use thumb.locked=1
instead, to change all poster selections to âlockedâ state. i.e. as if you had selected a poster manually on each item.
However, the usefulness of this is limited â particularly when you change the metadata agent afterwards. Because a different metadata agent might also provide a different list of posters to choose from. Locking the poster wonât preserve the poster which was delivered by the previously used metadata agent â simply because it might not be available anymore.
Other uses: There are other uses for this method of API access.
- Here it is used to unlock the âcritic raticâ field in a movie library, because it is no longer available in the edit dialog: IMDB rating graphic on TV Shows but using The Movie DB ratings - #16 by OttoKerner
- Here are some uses for a music library: New Music Metadata handling - #10 by OttoKerner
- Or unlock all the âcollectionâ fields to go from manual collections to automatically created ones: How to unlock locked metadata fields en masse - #5 by OttoKerner