NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 … 13 14 15 16 17 … 56 Next »
updated recoverrecordings.bat

 
  • 0 Vote(s) - 0 Average
updated recoverrecordings.bat
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#1
2008-10-25, 08:31 AM (This post was last modified: 2008-11-12, 02:53 AM by pBS.)
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 Big Grin
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
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..Wink [convert e:\mpg to \\server\share]
Fixed: paths with spaces now corrected..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
MixMan
Offline

Posting Freak

Posts: 1,239
Threads: 100
Joined: Oct 2005
#2
2008-10-25, 09:12 AM
Very nice file :-)
Just what I needed ... after forgetting to do backups.
Do you have more useful BAT files?
Best Regards
MixMan
[SIZE="1"]
Antec Fusion case with Gigabyte GA-MA78GM-SH, AMD X2 4850e, 2GB RAM, AMD780G Onboard graphics. WinTV-PVR 150 MCE (With FM), Twinhan DVB-T, 750GB + 250GB HDD. Windows XP Pro SP3, MCE 2005 Remote, 29" 4:3 monitor and a 47" Philips 9603H LCD[/SIZE]
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#3
2008-10-25, 10:12 PM
sure i do...Big Grin tried the super simple archiver? used to keep up with my dvdburner batch file but there are better alternatives out there nowdays..

i did make a couple to clean out the db but still need some work..

oh and recordingstatus.bat that spits out same info as tray app for my vfd display..
[tho i use it with smartielcd and a helper app too]

also made a 'sendshow.bat' to send show info to another gbpvr as it's recorded..
[tho easier now to just do a pvrx2 -import:"file.xml" from the other machine]

plus in this thread there are a couple more:
http://forums.nextpvr.com/showthread.php?t=20995
like formatting an email with pending recordings, lookup of show info,etc..
would like to add new ones to that thread if you have any to add..Smile

i you need any help with batches i'm glad to help..Big Grin
with a little creative thinking there's little [logic-wise] you can't do with a batch [specially with for-loops..lol]

here's the tip for the day: wanna search/replace in a variable? use %varConfusedtring=newstring%
so say i have a variable %var% with a value of Thishere
if i reference it with %var:This=Thatt% instead of %var%, reading the variable would produce Thatthere instead of Thishere
note: doesn't work with single % vars like %1 %2

tip#2: alternative ways to remove quotes:
%var:~1,-1% [removes first and last character]
%var:"=% [replaces ALL " with nothing]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
serafis
Offline

Member

Posts: 108
Threads: 23
Joined: Apr 2007
#4
2008-11-05, 11:15 PM
Very useful file thanks - or at least it would be if my recordings had any :metadata.xml attached to them!

Does anyone know if GBPVR's transcoding from Mpeg to Xvid (which I have set up to run automatically in the Config / Processing tab) loses this information, and whether there's any way to retain it?

Also, I've attached a copy of the code with minor modifications to include quote marks around the redirection output file strings, so that it will work when there are spaces in the recordings folder name (e.g. "E:\My TV Recordings")

Thanks again for this.

Code:
@echo off
set out=%~dp0
echo %out%
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
[SIZE="1"]Near-silent budget HTPC: X-case w/ ACBel 400W quiet PSU, 2x undervolted (5V) 80mm case fans, ASUS M2A-VM-HDMI, silent Asus nVidia 9400GT, AMD X2 4800+, 2GB Corsair DDR800, Windows XP/SP3, Hauppauge HVR-900 hybrid tuner + PVR150MCE analog, GBPVR PVRX2 (latest), CyberLink H.264 PDVD(7), Monogram AAC, FFDShow video & audio, VMR9-FSE

HDMI -> Panasonic PTAX100E 100" 720p/1080i projector, S-Video -> 27" CRT TV, SP/DIF -> Denon AVR3805 (7.1) + Q-Acoustics 1030 / 1010 speakers, Harmony 525 remote[/SIZE]
liteswap
Offline

Senior Member

Posts: 713
Threads: 70
Joined: Aug 2006
#5
2008-11-06, 04:01 PM
@pBS - for some reason, GBPVR seems to have lost track of one or two files in my standard TV Recordings directory. If I run recoverrecordings.bat in TV Recordings, will it just import the 'lost' files if I then import it into GBPVR, or will I get duplicates of existing entries?
- Silent client PVR: HDPlex HS.1 aluminium fanless case / Thin-ITX ASRock H81TM-ITX motherboard / Intel Celeron 1850T CPU / 4GB RAM / 120GB SSD / TBS6982 DBS-S2 [SIZE=1]dual-tuner card / Win10+nPVR+Plex Media Player feeding LG OLED55B6V + Anthem MRX510 AV Receiver / PMC GB1 / B&W / REL speakers.
- Noisy NAS: Xeon / Intel mobo / 16GB RAM / FreeNAS + Ubuntu VMs on VMware ESXi + 12TB RAID
[/SIZE] running Plex Media Server

MixMan
Offline

Posting Freak

Posts: 1,239
Threads: 100
Joined: Oct 2005
#6
2008-11-07, 12:40 PM
pBS Wrote:i you need any help with batches i'm glad to help..Big Grin
with a little creative thinking there's little [logic-wise] you can't do with a batch [specially with for-loops..lol]

Hi pBS

I'm finishing the Batch file for the Batch-Installer.
Do you know a way to read the ActiveSkin string from config.xml with DOS commands?

You can download a working "demo" of the Batch-Installer for Photo Screen Saver from my home server....and have a look at the batch files.
http://startop.homeftp.net/Plugin.Batch-Installer.zip
Best Regards
MixMan
[SIZE="1"]
Antec Fusion case with Gigabyte GA-MA78GM-SH, AMD X2 4850e, 2GB RAM, AMD780G Onboard graphics. WinTV-PVR 150 MCE (With FM), Twinhan DVB-T, 750GB + 250GB HDD. Windows XP Pro SP3, MCE 2005 Remote, 29" 4:3 monitor and a 47" Philips 9603H LCD[/SIZE]
carpeVideo
Offline

Posting Freak

Posts: 824
Threads: 23
Joined: Dec 2006
#7
2008-11-09, 12:43 AM
http://gbpvr.com/pmwiki/pmwiki.php/Utility/VidImport
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#8
2008-11-11, 11:02 AM
liteswap Wrote:@pBS - for some reason, GBPVR seems to have lost track of one or two files in my standard TV Recordings directory. If I run recoverrecordings.bat in TV Recordings, will it just import the 'lost' files if I then import it into GBPVR, or will I get duplicates of existing entries?


it will make a new recordings-dump.xml that includes all files, but if you import them, i believe it will update existing ones...i never had any duplicates...

serafis: looks liek you missed a couple at the bottom,[Extract] but thanks for pointing that out...Big Grin will fix and test and update main post...

MixMan: haven't looked at the files yet but it'd be pretty hard to extract the info from config.xml with batch,as they use lots of illegal chars that are hard to deal with in dos...
[manly "<>!?@" etc.]
i use a tiny autoit app to extract xml stuff...way easier...
[specially now that it has console app compiling..Smile]
i just write to console and read it in batch with for-loop...
tho it could be done if you can test for a string, or use as delimiter <> etc
i found it choked on the first line usually...
[it's a doozy]
<?xml version="1.0" encoding="UTF-8"?>
[double redirections>< and 2 ?'s, both have special meaning]

only reason mine works is i don't alter the data except to skip a line...
if i peek at the data on the line it chokes..

p.s. sorry i lost this thread on a power outage...lol
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#9
2008-11-12, 03:29 AM
MixMan Wrote:Hi pBS

I'm finishing the Batch file for the Batch-Installer.
Do you know a way to read the ActiveSkin string from config.xml with DOS commands?

You can download a working "demo" of the Batch-Installer for Photo Screen Saver from my home server....and have a look at the batch files.
http://startop.homeftp.net/Plugin.Batch-Installer.zip

looked at the batches, best bits i can offer is you can use taskkill.exe [included with all windows's] to kill processes.. [taskkill /f /im "GBPVRtray.EXE"]
and use start instead of run? utility..eg: start "" "%InstallDir%\pvrx2.exe"

AHA...want to read something from the config.xml? here's your line..lol
Code:
for /f "usebackq tokens=1,2,3,* delims=<>" %%f in (`findstr /i  "<ActiveSkin>" config.xml`) do echo %%h
just change the echo to either set a var or whatever..
i forgot i had problems writing back the data, not reading it..lol
[and findstr can be quite handy]
hope that helps...Big Grin
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
MixMan
Offline

Posting Freak

Posts: 1,239
Threads: 100
Joined: Oct 2005
#10
2008-11-12, 12:52 PM
Thanks very much

You can see the final result of the Installer here.
http://gbpvr.com/pmwiki/pmwiki.php/Devel...hInstaller
Best Regards
MixMan
[SIZE="1"]
Antec Fusion case with Gigabyte GA-MA78GM-SH, AMD X2 4850e, 2GB RAM, AMD780G Onboard graphics. WinTV-PVR 150 MCE (With FM), Twinhan DVB-T, 750GB + 250GB HDD. Windows XP Pro SP3, MCE 2005 Remote, 29" 4:3 monitor and a 47" Philips 9603H LCD[/SIZE]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  UK Freeview & Freesat Channel Logos (Updated) Lao Pan 58 30,802 2025-06-08, 02:46 PM
Last Post: Lao Pan
  Blue-Retro-SHV Skin updated Jaggy 55 26,932 2018-01-09, 12:52 AM
Last Post: Jaggy
  AutoRefresh Updated (27th Oct 2013) imilne 0 2,047 2013-10-27, 02:43 PM
Last Post: imilne
  AutoRefresh - Updated 21st December, 2012 imilne 0 2,232 2012-12-21, 02:55 PM
Last Post: imilne
  System - Updated 19th December, 2012 imilne 0 2,272 2012-12-19, 08:38 PM
Last Post: imilne
  AutoRefresh - Updated 13th April, 2012 imilne 0 2,027 2012-04-13, 07:36 PM
Last Post: imilne
  System - Updated 25th February, 2012 imilne 0 1,782 2012-02-25, 11:11 AM
Last Post: imilne
  AutoRefresh - Updated 18th February, 2012 imilne 0 1,592 2012-02-18, 10:04 AM
Last Post: imilne
  SubMenu - Updated January 23rd, 2012 imilne 0 1,554 2012-01-23, 09:52 AM
Last Post: imilne
  New wiki entry: RecoverRecordings pBS 11 4,019 2010-01-29, 08:16 AM
Last Post: pBS

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode