I updated the RecoverRecordings.bat file for the changes in newer versions.
[had to take out redundant first line of xml]
if you use a ntfs recording drive and lose your database,this can build a recording-dump.xml you can import back in by looking at the show:metadata.xml file attached on each...
To use: just stick it in your recordings dir and run it..it will create a recordings-dump.xml in that dir that you can then import from config.exe or command line pvrx2.
Checks for any files with metadata,.mpg,.ts.avi.wmv
fairly simple and foolproof....lol
Enjoy!
also can be run from a net dir..still trying to figure out how to alter the path to net paths while i import..maybe soon.. [convert e:\mpg to \\server\share]
Fixed: paths with spaces now corrected..
[had to take out redundant first line of xml]
if you use a ntfs recording drive and lose your database,this can build a recording-dump.xml you can import back in by looking at the show:metadata.xml file attached on each...
To use: just stick it in your recordings dir and run it..it will create a recordings-dump.xml in that dir that you can then import from config.exe or command line pvrx2.
Checks for any files with metadata,.mpg,.ts.avi.wmv
fairly simple and foolproof....lol
Enjoy!
Code:
@echo off
set out=%~dp0
echo.
echo. Generating Recording Import data for all recordings in %out% to
echo. %out%\recording-dump.xml
echo.
FOR /F "tokens=*" %%i IN ("<?xml version="1.0" encoding="UTF-8"?>") DO ECHO %%i> "%out%\recording-dump.xml"
FOR /F "tokens=*" %%i IN ("<recordings>") DO ECHO %%i>> "%out%\recording-dump.xml"
FOR /R %out% %%f IN (*.mpg *.ts *.avi *.wmv) DO (call :extract "%%~f")
rem :: more < %%f:metadata.xml >> "%out%\recording-dump.xml"
FOR /F "tokens=*" %%i IN ("</recordings>") DO ECHO %%i>> "%out%\recording-dump.xml"
echo.
echo Done.
echo.
echo No metadata.xml found attached to above files..all others imported.
pause
notepad.exe %out%\recording-dump.xml
goto :eof
:extract
for /f "usebackq tokens=* skip=1" %%p in ("%~1:metadata.xml") do (
if "%%p" == "<recording>" (
echo %%p>>%out%\recording-dump.xml
) else (
if "%%p" == "</recording>" (echo %%p>>"%out%\recording-dump.xml") else (
echo %%p>>"%out%\recording-dump.xml")
)
)
goto :eof
Fixed: paths with spaces now corrected..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie