Closed danrahn closed 6 months ago
Outstanding. Thank you.
Might you feel like tackling another bit ?
The Plex PhotoTranscoder cache loves to collect a lot of files. PMS is supposed to clean them up after 30 days but often doesn't due to Scheduled Tasks limitations (allotted time)
I have added this capability (Prune) to DBRepair.sh.
Would you mind taking a look at it and consider adding an issue in this Repo (Enhancement Request) with PR which adds the cleanup I added?
Outstanding. Thank you.
Might you feel like tackling another bit ?
The Plex PhotoTranscoder cache loves to collect a lot of files. PMS is supposed to clean them up after 30 days but often doesn't due to Scheduled Tasks limitations (allotted time)
I have added this capability (Prune) to DBRepair.sh.
Would you mind taking a look at it and consider adding an issue in this Repo (Enhancement Request) with PR which adds the cleanup I added?
I can take a look! Batch scripts definitely aren't my forte, but I'll see what I can come up with.
How's your Powershell?
Another user is helping with prune as well as configuration detection.
This is starting to feel VERY much like we need to move to a proper collaborative effort for Windows just like exists for Linux?
How's your Powershell?
Shaky at best. Google has been my friend for a lot of the changes I've made here, but I'm comfortable enough with Windows and Plex that things have been relatively smooth so far.
Another user is helping with prune as well as configuration detection.
This is starting to feel VERY much like we need to move to a proper collaborative effort for Windows just like exists for Linux?
Yeah, it'd be great if there was an effort to get the Windows script in-line with the Linux one. If the other user working on this is actually familiar with Powershell, I'd probably defer to them, given my lack of experience with PS mentioned above 😅
There are a few scenarios where the current logic to find the PMS install directory will fail:
%PROGRAMFILES(X86)%
, not%PROGRAMFILES%
, which this script doesn't check for. Additionally, there seems to be a bug that doesn't correctly setInstallFolder
in the registry, resulting in us looking in the wrong folder.InstallPath
is written toHKLM
instead ofHKCU
- I'm not sure what determines where the key gets saved (maybe it's new behavior surrounding the recentInstallPath
fixes in PMS), but in one of my tests it was added toHKLM
, but we only checkHKCU
.This change attempts to address those issues by doing the following:
InstallPath
check inHKLM\Software\Plex, Inc.\Plex Media Server
InstallPath
isn't set, or the givenInstallPath
results in a path toPlex SQLite
that doesn't exist, check%PROGRAMFILES%
%PROGRAMFILES%
, look in%PROGRAMFILES(X86)%
Plex SQLite.exe
.Validation:
%PROGRAMFILES%
%PROGRAMFILES%
due to an incorrectInstallFolder
, but we then realize%PlexSQL%
doesn't exist, so are able to successfully fall back to"%PROGRAMFILES(X86)%\Plex\Plex Media Server\Plex SQLite.exe"
%PROGRAMFILES%
For custom install paths, it works as expected as long as it's properly set, in
HKCU
orHKLM
, but as mentioned above, it seems like that might not always be the case.Fixes: #143