fix up autothumbs

This commit is contained in:
2025-10-15 18:28:09 -06:00
parent b8418641e1
commit 12afbdf343
3 changed files with 659 additions and 20 deletions

View File

@@ -58,9 +58,14 @@ echo DEBUG: WINPATH = %WINPATH%
echo DEBUG: RELPATH = %RELPATH%
echo DEBUG: NASPATH = %NASPATH%
echo.
REM SSH cleanup - run nascleanup.sh on NAS if available
echo Running SSH cleanup on NAS...
ssh Hydra "bash -lc 'if [ -x ~/nascleanup.sh ]; then ~/nascleanup.sh \"%NASPATH%\"; else echo \"nascleanup.sh not found on NAS at ~/nascleanup.sh. Upload it or run cleanup manually.\"; fi'"
REM Ensure nascleanup.sh exists on NAS (upload + fix line endings), then run it
echo Uploading nascleanup.sh to NAS and running cleanup...
if not exist "%~dp0nascleanup.sh" (
echo ERROR: nascleanup.sh not found next to this batch file.
goto END
)
ssh Hydra "cat > ~/nascleanup.sh" < "%~dp0nascleanup.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/nascleanup.sh; else tr -d \"\r\" < ~/nascleanup.sh > ~/nascleanup.sh.tmp && mv ~/nascleanup.sh.tmp ~/nascleanup.sh; fi; chmod +x ~/nascleanup.sh; ~/nascleanup.sh \"%NASPATH%\"'"
goto END
:BOTH
@@ -88,9 +93,15 @@ ssh Hydra "bash -lc '~/extract_eadir_to_tmp.sh \"%NASPATH%\" || true'"
REM Run psthumbgen.py
python psthumbgen.py --directory "%WINPATH%"
REM SSH cleanup - run nascleanup.sh on NAS if available
echo Running SSH cleanup on NAS...
ssh Hydra "bash -lc 'if [ -x ~/nascleanup.sh ]; then ~/nascleanup.sh \"%NASPATH%\"; else echo \"nascleanup.sh not found on NAS at ~/nascleanup.sh. Upload it or run cleanup manually.\"; fi'"
REM SSH cleanup commands (run separately)
REM Ensure nascleanup.sh exists on NAS (upload + fix line endings), then run it
echo Uploading nascleanup.sh to NAS and running cleanup...
if not exist "%~dp0nascleanup.sh" (
echo ERROR: nascleanup.sh not found next to this batch file.
goto END
)
ssh Hydra "cat > ~/nascleanup.sh" < "%~dp0nascleanup.sh"
ssh Hydra "bash -lc 'if command -v dos2unix >/dev/null 2>&1; then dos2unix -f ~/nascleanup.sh; else tr -d \"\r\" < ~/nascleanup.sh > ~/nascleanup.sh.tmp && mv ~/nascleanup.sh.tmp ~/nascleanup.sh; fi; chmod +x ~/nascleanup.sh; ~/nascleanup.sh \"%NASPATH%\"'"
goto END
:FIX_ONEDRIVE