2010-06-22, 07:22 AM
Any SQL gurus out there? I need a bit of help please in completing an SQL query to retrieve the next pending & in-progress recordings from the new schema in the NPVR.db3 database.
Using GBPVRWAKE, postprocessing.bat & parallelprocessing.bat I pipe these into a text file so I can use LCDSmartie to display them on my iMON VFD. This means theat I can easily see if anything is recording or about to record and for example I don't then put the PC into standby if there is. Also when the PC is in standby it displays the time the PC will wake for its next recording. With GBPVR this function was provided by the GBPVRCli program (provided as part of the SlimmGBPVR utility); the auther has confirmed this is not planned to be updated for NPVR.
I've got this far modifying SQL that I've plagiarised from the forum (thanks pBS) which runs via the SQLITE3 command line utility .
What I need a bit of help with please is:
1. The times returned for start/end time are an hour early. I assume this is as actual time (in UK) is currently BST but it is reporting GMT (or UMT).
2. I can get 'name', 'start_time' & 'end_time' but 'subtitle' is now only kept within an XML subfields structure in the 'event_details' field shown below. I can't see an easy way to get at just this.
Thanks
Using GBPVRWAKE, postprocessing.bat & parallelprocessing.bat I pipe these into a text file so I can use LCDSmartie to display them on my iMON VFD. This means theat I can easily see if anything is recording or about to record and for example I don't then put the PC into standby if there is. Also when the PC is in standby it displays the time the PC will wake for its next recording. With GBPVR this function was provided by the GBPVRCli program (provided as part of the SlimmGBPVR utility); the auther has confirmed this is not planned to be updated for NPVR.
I've got this far modifying SQL that I've plagiarised from the forum (thanks pBS) which runs via the SQLITE3 command line utility .
Code:
REM pending 3 recordings
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT name from SCHEDULED_RECORDING where status = '0' order by start_time limit 3;" > "C:\Users\Public\NPVR\EXTRAS\PendName.txt"
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT strftime('%%d-%%m %%H:%%M',start_time) from SCHEDULED_RECORDING where status = '0' order by start_time limit 3;" > "C:\Users\Public\NPVR\EXTRAS\PendTime.txt"
Rem IN-PROGRESS recordings (for upto three tuners)
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT name from SCHEDULED_RECORDING where status = '1' order by start_time limit 3;" > "C:\Users\Public\NPVR\EXTRAS\ProgName.txt"
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT strftime('%%H:%%M',end_time) from SCHEDULED_RECORDING where status = '1' order by start_time limit 3;" > "C:\Users\Public\NPVR\EXTRAS\ProgTime.txt"
REM next pending recording for USBPORT file for display during standby
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT name from SCHEDULED_RECORDING where status = '0' order by start_time limit 1;" > "C:\UTILS\LCDsmartie\USBPortExit.txt"
"sqlite3.exe" -separator " -- " "npvr.db3" "SELECT strftime('%%d-%%m %%H:%%M',start_time) from SCHEDULED_RECORDING where status = '0' order by start_time limit 1;" >> "C:\UTILS\LCDsmartie\USBPortExit.txt"
1. The times returned for start/end time are an hour early. I assume this is as actual time (in UK) is currently BST but it is reporting GMT (or UMT).
2. I can get 'name', 'start_time' & 'end_time' but 'subtitle' is now only kept within an XML subfields structure in the 'event_details' field shown below. I can't see an easy way to get at just this.
Code:
<Event>
<OID>752285</OID>
<Title>Match of the Day</Title>
<SubTitle>World Cup 2010</SubTitle>
<Description>Colin Murray presents highlights of the day's three group matches, with all the reaction from England's clash with Algeria in Cape Town. The day's other Group C game sees the USA take on Slovenia in Johannesburg, while Germany meet Serbia in Group D.</Description>
<ChannelOID>6864</ChannelOID>
<StartTime>2010-06-18T21:00:00.0000000</StartTime>
<EndTime>2010-06-18T21:30:00.0000000</EndTime>
</Event>
Silverstone LC10M with iMON
Gigabyte 780G+4850e, AMD 6570
Blackgold BGT3620, Harmony 555 Remote
Win7 32-bit, SAF
Gigabyte 780G+4850e, AMD 6570
Blackgold BGT3620, Harmony 555 Remote
Win7 32-bit, SAF