Compare commits

..

4 Commits

Author SHA1 Message Date
causefx
212162dece Merge cfddb949c4 into 47bd6e7c56 2023-10-11 08:54:56 -07:00
causefx
cfddb949c4 change 98 to 88 on update 2023-10-11 08:54:22 -07:00
Chuck
47bd6e7c56 Merge pull request #101 from psitem/master
Plex path discovery on Windows
2023-10-08 14:11:36 -07:00
psitem
beeaa88315 Plex path discovery
Discover Plex paths.
Correct mkdir statement to md.
2023-10-08 09:37:17 -04:00
2 changed files with 31 additions and 8 deletions

View File

@@ -6,8 +6,7 @@ REM - everything is done without need to interact.
REM REM
REM -- WARNNING -- WARNING -- WARNING REM -- WARNNING -- WARNING -- WARNING
REM REM
REM 1. This is stable working software but not "Released" software. Development will continue. REM This is stable working software but not "Released" software. Development will continue.
REM 2. You must ensure variable PlexData points to your databases. (there is no automatic detection at this time)
REM REM
REM ### Create Timestamp REM ### Create Timestamp
set Hour=%time:~0,2% set Hour=%time:~0,2%
@@ -20,9 +19,33 @@ set Hour=%Hour: =%
REM ## Set TimeStamp ## REM ## Set TimeStamp ##
set TimeStamp=%Hour%-%Min%-%Sec% set TimeStamp=%Hour%-%Min%-%Sec%
REM These assume PMS is in the default location REM Find PMS database location
set "PlexData=%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases" for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "LocalAppDataPath" 2^> nul') do set "PlexData=%%b\Plex Media Server\Plug-in Support\Databases"
set "PlexSQL=%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite" if not exist "%PlexData%" (
if exist "%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases" (
set "PlexData=%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases"
) else (
echo Could not determine Plex database path.
echo Normally %LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases
echo.
goto :EOF
)
)
REM Find PMS installation location.
for /F "tokens=2* skip=2" %%a in ('REG.EXE QUERY "HKCU\Software\Plex, Inc.\Plex Media Server" /v "InstallFolder" 2^> nul') do set "PlexSQL=%%b\Plex SQLite.exe"
if not exist "%PlexSQL%" (
if exist "%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe" (
set "PlexSQL=%PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe"
) else (
echo Could not determine SQLite path.
echo Normally %PROGRAMFILES%\Plex\Plex Media Server\Plex SQLite.exe
echo.
goto :EOF
)
)
REM Set temporary file locations
set "DBtmp=%PlexData%\dbtmp" set "DBtmp=%PlexData%\dbtmp"
set "TmpFile=%DBtmp%\results.tmp" set "TmpFile=%DBtmp%\results.tmp"
@@ -42,7 +65,7 @@ if %ERRORLEVEL%==0 (
cd "%PlexData%" cd "%PlexData%"
mkdir "%PlexData%\dbtmp" 2>NUL md "%PlexData%\dbtmp" 2>NUL
del "%TmpFile%" 2>NUL del "%TmpFile%" 2>NUL
echo %time% -- Exporting Main DB echo %time% -- Exporting Main DB

View File

@@ -1611,7 +1611,7 @@ do
echo " 11 - 'status' - Report status of PMS (run-state and databases)" echo " 11 - 'status' - Report status of PMS (run-state and databases)"
echo " 12 - 'undo' - Undo last successful command" echo " 12 - 'undo' - Undo last successful command"
echo "" echo ""
echo " 98 - 'update' - Check for script update" echo " 88 - 'update' - Check for script update"
echo " 99 - 'quit' - Quit immediately. Keep all temporary files." echo " 99 - 'quit' - Quit immediately. Keep all temporary files."
echo " 'exit' - Exit with cleanup options." echo " 'exit' - Exit with cleanup options."
fi fi
@@ -1913,7 +1913,7 @@ do
DoUndo DoUndo
;; ;;
98|upda*) 88|upda*)
DoUpdate=0 DoUpdate=0
Output "Checking for script update" Output "Checking for script update"