refactor error handling and guidance

This commit is contained in:
2026-03-22 12:51:08 -06:00
parent 59f1c1c38e
commit a8205447e3
4 changed files with 853 additions and 56 deletions
+21 -2
View File
@@ -72,7 +72,13 @@ if not exist "%~dp0nascleanup.sh" (
)
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%\"'"
call :WIN_REMOVE_LOCAL_EADIR_TMP
if errorlevel 1 (
echo ERROR: nascleanup failed on NAS - check promote ^(eaDir_tmp -^> @eaDir^) messages above.
echo Keeping eaDir_tmp on the share so you can retry without re-running FFmpeg.
call :PRINT_HYDRA_CLEAR_EADIR
) else (
call :WIN_REMOVE_LOCAL_EADIR_TMP
)
goto END
:BOTH
@@ -117,7 +123,13 @@ if not exist "%~dp0nascleanup.sh" (
)
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%\"'"
call :WIN_REMOVE_LOCAL_EADIR_TMP
if errorlevel 1 (
echo ERROR: nascleanup failed on NAS - check promote ^(eaDir_tmp -^> @eaDir^) messages above.
echo Keeping eaDir_tmp on the share so you can retry without re-running FFmpeg.
call :PRINT_HYDRA_CLEAR_EADIR
) else (
call :WIN_REMOVE_LOCAL_EADIR_TMP
)
goto END
:FIX_ONEDRIVE
@@ -163,6 +175,13 @@ echo 3. Your custom thumbnails should now have priority!
echo.
goto END
REM Print ssh Hydra command to wipe @eaDir when NAS cleanup failed (matches NASPATH from pasted R:\ path).
:PRINT_HYDRA_CLEAR_EADIR
if "%NASPATH%"=="" goto :eof
echo To clear locked @eaDir on Hydra: ssh in first, then run:
echo sudo rm -rf "%NASPATH%/@eaDir"
goto :eof
REM Remove folder-level @eaDir on the pasted Windows path (same files as NAS over SMB).
:WIN_REMOVE_LOCAL_EADIR
if "%WINPATH%"=="" goto :eof