And, as some general feeback to the thread, I do have to say Plex is feeling noticeably more responsive, but I wouldn’t say it is popping up search results as fast as I type as others have mentioned. However, the results are displayed only a split second after I finish typing. Maybe I’m just a fast typist.
Overall, quite happy with the results of the tool.
I was on reddit reading how to optimize Plex database and came across this thread.
Unfortunately, I’m using Plex on Truenas Scale (Truecharts version) and I can’t find a way to get your app to work.
I might be wrong, but from what I’ve seen you only need the data stored inside “Library/Application Support/Plex Media Server”
I can mount the Plex volume into a specified path thanks to heavyscript. It give me something like: /mnt/MY_POOL/mounted_pvc/plex-config/Library/Application\ Support/Plex\ Media\ Server/
I think that the missing part might be sqlite3, but it seems to be installed on Truenas:
root : sqlite3
SQLite version 3.34.1 2021-01-20 14:10:07 Enter “.help” for usage hints. Connected to a transient in-memory database. Use “.open FILENAME” to reopen on a persistent database.
I don’t know if it’s possible and I can’t find anyone who asked the question on this thread, that’s why I’m asking it.
You missed a key piece of info then started down the hole
In the README.md –
EXAMPLE: Using DBRepair inside containers (manual start/stop included)
(Select containers allow stopping/starting PMS from the menu. See menu for details)
sudo docker exec -it plex /bin/bash
# extract from downloaded version file name then cd into directory
tar xf PlexDBRepair-1.0.0.tar.gz
cd PlexDBRepair-1.0.0
chmod +x DBRepair.sh
./DBRepair.sh
On systems with Plex in a container:
Everybody puts their container in an unpredictable location
The only standards exist once inside the container
The script understands how different container images are structured, detects this, and self configures.
After self-configuration is complete, you see the Image name (or real host name if native) in the menu (examples also shown in the README.md)
Suggest you take a few minutes and read the entire README.md
Yeah I saw that, however the issue is that I’m not able to stop PMS with the script (Not available, stop manually) and since it’s running inside kubernetes, when I try kill -15 PMS (something like this) it restart the pod, so I can’t run the script
I must be missing something but I don’t know what.
I am considering adding another function to DBRepair.
The function I’m considering is not a database related function
It does PMS maintenance which seems to not work correctly.
Specifically,
Remove JPG files from the Cache/PhotoTranscoder directory
As currently written,
Examine (Count) the number of JPGs found in the directory > 30 days old
If any found, offer to delete them
If in scripted/command line argument mode, Assume “YES” to remove them.
Given there are cases where the PhotoTranscoder directory has grown to ridiculous sizes, the most I’m willing to do is count the number of files which would be removed but even this will take time. I don’t want to waste even more time finding out how much disk space will be recovered (UNLESS that’s wanted)
Gets my vote. I’ve been nuking this cache weekly via a cron job for years. The cache is just bloat, or at least it is based off my users usage of plex.
Chuck, FWIW, I just checked my PT folder. It’s 20GB with about 120k files and 256 folders. Not a single file is older than 30 days. So, I guess that shows that the cache CAN be well behaved
I like the idea of your very useful tool becoming even more useful so it gets my vote. I don’t need disk space recovered info; having the count is good enough to identify if the expected cache clean-up was misbehaving.