UPDATED
i made this little mod to archive a whole series[directory] of shows at once..
remember to place .bat in "gbpvr\third party\" and add new profile and this batch..
Code:
@echo off
:: cls
echo ********* >>"third party\archiver.log"
set db=GBPVR.DB3
for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims=\" %%d in ("%~dp1") do (
if not "%%d"=="" set filedir=%%d
if not "%%e"=="" set filedir=%%e
if not "%%f"=="" set filedir=%%f
if not "%%g"=="" set filedir=%%g
if not "%%h"=="" set filedir=%%h
if not "%%i"=="" set filedir=%%i
if not "%%j"=="" set filedir=%%j
if not "%%k"=="" set filedir=%%k
if not "%%l"=="" set filedir=%%l
if not "%%m"=="" set filedir=%%m
)
echo Subdir is %filedir%
for %%d in ("%~dp1*.mpg" "%~dp1*.avi" "%~dp1*.wmv" "%~dp1*.ts" "%~dp1*.dvr-ms" ) do (
call :adjust "%%d" "%~2"
)
goto :eof
:adjust
echo %1
set oid=
for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%db%" "SELECT programme_oid FROM recording_schedule where filename like '%%%~nx1'; " `) do set oid=%%v
if "%oid%" EQU "" (
echo.
echo ******** That file is not in GBPVR database!
rem goto :eof
) else (echo Found in GBPVR database! )
echo.
if not exist "%~2%filedir%\" md "%~2%filedir%\"
copy /Y "%~dpn1.*" "%~2%filedir%\"
if not errorlevel 1 (
echo running sqlite >>"third party\archiver.log"
sqlite3.exe -separator "," "%db%" "UPDATE RECORDING_SCHEDULE SET filename ='%~2\%filedir%\%~nx1' where filename like '%%%~nx1';"
del /q "%~dpn1.*"
) else (
echo errors = %errorlevel% >>"third party\archiver.log"
echo Copy problem!
)
echo Done.
echo %date% %time% Copied "%~dpn1.*" to %2 >>"third party\archived.txt"
goto :eof
[save as relocdir.bat]
sample profile: [adjust for your needs]
Code:
<Conversion name="Archive ENTIRE directory" exe="relocdir.bat" cmd=" {SOURCE_FILE} \\home\g\mpg\ >>archives.txt" targetExtension=".mov" />
Updated to handle .avi .wmv .ts and .dvr-ms too