Server Version#:
Player Version#:
A simple question: is there a way to tell PMS to write all recent edits to the db-file, besides just quitting the app?
Server Version#:
Player Version#:
A simple question: is there a way to tell PMS to write all recent edits to the db-file, besides just quitting the app?
What changes are you talking about?
If you scan a library’s files, those changes should be applied immediately.
If you refresh a library’s / item’s metadata, those changes should be applied immediately.
If you edit metadata, this should be applied when you save the item.
If you edit library settings, those should be applied when you confirm/save the library modal.
If you edit server settings, those should be applied when you save your changes.
There should be no need to trigger Plex to write anything to its database (beyond clicking a save button if you manually update things). Quitting the app shouldn’t have anything to do with this in the first place.
Also make sure you are not disabling the lock which is auto applied when editing a field, (You still need to hit save) Orange = Locked
Well, it’s like this:
I add some folders with movies to my library on disk.
I then choose “Scan library files” in PMS, and those movies show up in the appropriate library there.
Then I start a sqlite script that reads com.plexapp.plugins.library.db and generates a large table of all metadata of all movies (much faster than Webtools, by the way).
The point is: that db-file does not contain the latest additions to my library unless I quit PMS. Well, that is my solution right now. And that is my question: is there a better way to accomplish this?
Jurgen
Naturally, since you are accessing the database directly (Not recommended) where as WebTools-NG use the Web based Rest API
Unsure here, since I would never ever access the database, and as such untested, but…
I suspect you are accessing the database file directly, and the changes are in the WAL file, that only get’s committed to the main file during a shutdown
Try and run a VACUUM on the database before running your script
Well, I first make a copy, of course, and then everything is fine. And really fast.
Well, then I might first try the WAL file. Thanks for the hint.
J
Do tell the outcome
Edit: And a Vacuum would merge the WAL file into the main file
Well, the thing is: the WAL file contains only incremental changes.
And the main library file on disk does not change when “Scan library files” updates PMS.
And as far as I understand, VACUUM does not operate on in-memory databases.
So to commit the latest updates to disk, I see no other way than to quit PMS.
Unless there is some hidden web hook to kick PMS …
J
Backup would do it as well
Issue a curl POST as https://IP_OF_PMS:32400/butler/BackupDatabase?X-PLEX-TOKEN=<YOUR TOKEN>
Then open the backup file instead
To find your token, look here: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.