NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 27 28 29 30 31 … 93 Next »
Current program details, from batch file!

 
  • 0 Vote(s) - 0 Average
Current program details, from batch file!
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#41
2007-03-12, 06:26 AM
with autoit i just capture the stdout of the sqlite command..which is run as a child process, so you should be able to do that with vb6...
sqlite just outputs to console the results,so capture that and no temp files needed...and very fast..Smile

you can always use the dll version of sqlite as well...
[probably best way really]

on other things i use the registry as tmp string space..very efficient..Smile
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#42
2007-03-12, 06:41 AM
pBS Wrote:with autoit i just capture the stdout of the sqlite command..which is run as a child process, so you should be able to do that with vb6...
sqlite just outputs to console the results,so capture that and no temp files needed...and very fast..Smile

you can always use the dll version of sqlite as well...
[probably best way really]

on other things i use the registry as tmp string space..very efficient..Smile

Have to say, I have no idea how to capture a console, without redirecting the output to a temp file. I WANNA KNOW!!!

And I've looked at the sqlite dll, but I think it's not for sqlite3...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#43
2007-03-12, 07:02 AM
hmm, you could use a for loop as the command, and have it use reg.exe to send the output to the registry if you can read that into vb6....Smile
it's fast as it's always loaded into memory and diskless...

variables aren't reliable cuz they typically don't get updated into the master environment,so get destroyed when the process exits...

put the reg.exe command at the end of the for loop in the do part like do reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Devnz\myplugin" /v "data1" /d "%%f" /f

[adding overwrites existing data so same to update it]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#44
2007-07-20, 11:12 AM
i adjusted the re-occuring saver for new fields in ver 1.x+ so should be fine for new versions..
Big Grin
works for me..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#45
2007-08-13, 09:49 PM
zehd Wrote:I stopped GB-PVR Recording service. I exported from my old database, seemed OK... So far, at least I have a list of shows I should reprogram

When I try to input the schedule, Seems OK, though there is an error: SQL error: unrecognized token: "','' );" and then the batch file crashes...

I start the service, start GB-PVR and when I go into recordings, 'Error: specified cast is not valid'

Any ideas?
something using an apostrophe " ' " in your data....mine too..fixed..

it's certain key chars in the data...i now see i need to use a different delimiter char, as ',' is too common in the show data..
so far i've gotten it to work with + as i can't find any of those in the data normally, so i have to adjust the batches to use it..

so far so good but sqlite isn't exporting blank values, eg if a field doesn't contain any data, it isn't exported,messing up the total # of fields..
i finally found a fix for that but still have to adjust the restore bat..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#46
2007-08-13, 10:05 PM
pBS Wrote:something using an apostrophe " ' " in your data....mine too..fixed..

it's certain key chars in the data...i now see i need to use a different delimiter char, as ',' is too common in the show data..
so far i've gotten it to work with + as i can't find any of those in the data normally, so i have to adjust the batches to use it..

so far so good but sqlite isn't exporting blank values, eg if a field doesn't contain any data, it isn't exported,messing up the total # of fields..
i finally found a fix for that but still have to adjust the restore bat..

The batch files got me a long way toward understanding the syntx for sqlite3, but I have since started using queries straight in my VB6 programs. Very slick
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#47
2007-10-04, 05:34 PM
In line with this being a nice place to post sqlite-related batch-commands, here's one I've been running a few days...

Basically it gives a total overview of GBPVR (failed recordings, conflicts, pending, reocurring), collects it into a single file and mails that out. I have it called from PostUpdateEPG, so that I have an overview of GBPVR in my mailbox each morning....

Code:
Rem ****************************************
Rem * GBPVR_Status                         *
Rem *--------------------------------------*
Rem * Gives an overview of current status  *
Rem * and mails that out...                *
Rem ****************************************
setlocal

Rem * Retrieve date for display
for /f "tokens=2-4 delims=- " %%g in ('date /t') do (
  set _dd=%%g
  set _mm=%%h
  set _yy=%%i
)
set _currdate=%_yy%-%_mm%-%_dd%

Echo GBPVR_Status (%_currdate% %time%) > c:\cron\GBPVR_Status.log

Rem * Conflicting recordings....
Echo ==================================================================== >> c:\cron\GBPVR_Status.log
Echo Conflicts: >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log
"C:\gbpvr\gbpvr\Third Party\sqlite3.exe" -separator "" c:\gbpvr\gbpvr\gbpvr.db3 "SELECT datetime(s.manual_start_time), ' -> ', s.filename,'(',p.sub_title, ')' FROM RECORDING_SCHEDULE AS s left  join PROGRAMME as p on s.programme_oid = p.oid where s.status = 5 ORDER BY s.manual_start_time;" >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log

Rem * Scheduled recordings (today + tomorrow)
Echo Pending recordings (next 2 days): >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log
"C:\gbpvr\gbpvr\Third Party\sqlite3.exe" -separator "" c:\gbpvr\gbpvr\gbpvr.db3 "SELECT datetime(s.manual_start_time), ' -> ', s.filename,'(',p.sub_title, ')' FROM RECORDING_SCHEDULE AS s left  join PROGRAMME as p on s.programme_oid = p.oid where (julianday(s.manual_start_time)-julianday('now')) < 2 AND (julianday(s.manual_start_time)-julianday('now')) > 0 AND s.status = 0 ORDER BY s.manual_start_time;" >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log

Rem * Failed recordings
Echo Failed recordings: >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log
"C:\gbpvr\gbpvr\Third Party\sqlite3.exe" -separator "" c:\gbpvr\gbpvr\gbpvr.db3 "SELECT datetime(s.manual_start_time), ' -> ', s.filename,'(',p.sub_title, ')' FROM RECORDING_SCHEDULE AS s left  join PROGRAMME as p on s.programme_oid = p.oid where s.status = 3 ORDER BY s.manual_start_time;" >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log

Rem * Season recordings...
Echo Currently defined season recordings (by priority): >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log
"C:\gbpvr\gbpvr\Third Party\sqlite3.exe" -separator "" c:\gbpvr\gbpvr\gbpvr.db3 "SELECT s.filename,'(',p.name,')' FROM RECORDING_SCHEDULE AS s left  join CHANNEL as p on s.manual_channel_oid = p.oid where s.status = 4 ORDER BY s.priority DESC" >> c:\cron\GBPVR_Status.log
Echo ==================================================================== >> c:\cron\GBPVR_Status.log


Echo End >> c:\cron\GBPVR_Status.log


Rem * Mail the file...
c:\cron\sleep 5
c:\cron\blat c:\cron\GBPVR_Status.log -to XYZ@gmail.com -s "GBPVR Status"

And here's a sample of the output....

Quote:GBPVR_Status (2007-10-04 6:01:59,54)
====================================================================
Conflicts:
====================================================================
====================================================================
Pending recordings (next 2 days):
====================================================================
2007-10-04 13:20:00 -> Sesamstraat(Dieren)
2007-10-04 17:25:00 -> Sesamstraat(Dieren)
2007-10-04 19:00:00 -> Mythbusters((4x21) - Air Cylinder Rocket)
2007-10-04 20:30:00 -> House(Fetal position)
2007-10-05 05:05:00 -> Stargate SG-1()
2007-10-05 13:20:00 -> Sesamstraat(Water)
2007-10-05 17:25:00 -> Sesamstraat(Water)
2007-10-05 19:00:00 -> Mythbusters(More myths revisited)
2007-10-05 20:30:00 -> Medium(Whatever possessed you)
2007-10-05 21:20:00 -> De Lamas()
2007-10-06 03:25:00 -> Star Trek: The Next Generation((3x14) - A Matter Of Perspective)
====================================================================
Failed recordings:
====================================================================
2007-09-13 20:30:00 -> House(Insensitive)
2007-09-28 05:05:00 -> Stargate SG-1()
2007-09-28 13:20:00 -> Sesamstraat(Bedenken)
2007-09-28 17:25:00 -> Sesamstraat(Bedenken)
2007-09-28 20:30:00 -> Medium(The boy next door)
2007-09-28 21:15:00 -> De Lamas()
2007-09-29 03:40:00 -> Star Trek: The Next Generation((3x12) - The High Ground)
2007-09-29 04:00:00 -> Stargate SG-1()
2007-09-29 04:25:00 -> Star Trek: The Next Generation((3x13) - Deja Q)
2007-09-30 05:05:00 -> Stargate SG-1()
2007-10-02 05:05:00 -> Stargate SG-1()
====================================================================
Currently defined season recordings (by priority):
====================================================================
Star Trek: The Next Generation(BBC 2)
De Lamas(Nederland 3)
House(SBS 6)
Greys anatomy(Net 5)
====================================================================
End

Have fun,
//Ton
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#48
2007-10-08, 05:33 AM
nice one...replaces a utili had back in access db days...
sure is nice to be able to get into the db so easily..Big Grin
thanx
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#49
2008-12-09, 08:52 AM (This post was last modified: 2008-12-26, 08:11 AM by pBS.)
here's a little next recording sql snippet..
tho now i see he included one in his above,this one just gives next one...
Code:
"sqlite3.exe" -separator " -- " "gbpvr.db3" "SELECT strftime('%%m-%%d %%H:%%M',manual_start_time), p.name from RECORDING_SCHEDULE AS s inner join PROGRAMME as p on s.programme_oid = p.oid  where status = '0' order by manual_start_time limit 1;"

returns a formatted date string:
Quote:12-09 09:00 -- The Daily Show With Jon Stewart
normally the strftime('%%m-%%d %%H:%%M',manual_start_time) should only have 1 %, but in batch files you have to use 2 %%
still trying to figure out how to adjust for 12hr display...i know it can be done...
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5


Possibly Related Threads…
Thread Author Replies Views Last Post
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,296 2015-08-25, 10:21 AM
Last Post: puck64
  Possible to have another element in details-single.xml Northpole 2 2,202 2014-07-11, 09:51 PM
Last Post: Northpole
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,783 2014-01-02, 06:36 AM
Last Post: bgowland
  Recording export tags and export details? spinnaker 10 4,384 2013-10-23, 01:48 AM
Last Post: mvallevand
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,765 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,270 2013-01-26, 05:14 AM
Last Post: bgowland
  Album art. Current conventions? bgowland 2 1,586 2012-12-21, 02:08 AM
Last Post: bgowland
  Skin element Details in NowNext Jaggy 2 1,778 2011-09-19, 11:50 PM
Last Post: Jaggy
  "Rating" in cached event details xml alibert 74 16,612 2011-03-28, 01:06 AM
Last Post: zehd
  NPVR batch files mvallevand 4 3,194 2010-11-27, 07:40 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode