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
#21
2006-10-27, 02:33 AM
actually i wanted to export the re-occurring schedule items..
exporting the files details is no problem...i just hate it when i want to do a fresh re-install, i have to manually resetup all my re-occurring ones [after i save them manually with pen and paper! Smile]
not a big deal as i don't do it often, but would be nice to have...
and just trying to understand the database structure a little more..Big Grin
does CDK save re-occurrings?
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
Jim_
Offline

Senior Member

Posts: 696
Threads: 21
Joined: Dec 2005
#22
2006-10-27, 02:59 AM
Oh yes, CDK / priorityrecordings / deleteschedule / regtracker are the answer to your dreams!
All the reoccurring recordings are stored in an xml file, dupe avoidance is stored in a db, simply copy them into the new install. Sorry I didn’t mention it earlier, I pretty much assume that everyone is using them already!Big Grin
That’s why I wanted to find a way of clearing deleted and conflict recordings. Using CDK / deleteschedule & the little sql command I posted above, only one-off recordings are locked (not updated) during an epg update.

Jim
[SIZE="1"]HP e9240f| Phenom II X4-945| Radeon HD4650 1-gig | 8 gig ram | Blu-Ray
Windows 7 64bit | 1TB system | 1.5TB Recordings | 3-TB Library
HDMI >> Sony 40" 1080p LCD TV
HVR-2250 | HVR-1290 | WinTV PVR USB2 | WinTV HD-PVR | GBPVR 1.4.7[/SIZE]
Projects: I-xmltv (Unsupported at this time) |
Jim_
Offline

Senior Member

Posts: 696
Threads: 21
Joined: Dec 2005
#23
2006-10-27, 04:06 AM
But! Big Grin
There are tons of people using the built-in scheduler. And export / import reoccurring recordings has been in the “wish list” section quite a few times.
I bet if you come up with a way to do it almost everyone will want it! Smile
[SIZE="1"]HP e9240f| Phenom II X4-945| Radeon HD4650 1-gig | 8 gig ram | Blu-Ray
Windows 7 64bit | 1TB system | 1.5TB Recordings | 3-TB Library
HDMI >> Sony 40" 1080p LCD TV
HVR-2250 | HVR-1290 | WinTV PVR USB2 | WinTV HD-PVR | GBPVR 1.4.7[/SIZE]
Projects: I-xmltv (Unsupported at this time) |
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#24
2006-10-27, 07:38 PM
A program could be written to use the priorityrecordings xml file format as an import and export mechanism. Just would need a program to read and write the xml (there is an API in RecordingUtils.dll to do this), and then write the information back into SQL Lite or whatever database.

CDK scheduler just reads the XML file to get it's recordings, nothing is stoping another program from using the file format for another purpose.
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#25
2006-10-29, 02:12 PM (This post was last modified: 2006-10-29, 02:20 PM by pBS.)
ahhh,but for my purposes, the capture source may change, along with other things about the system...[capture name etc.]
remember this will be a fresh install...i think it just requires a few more cross-references..
so i'll have to find a new way to deal with those things...it's already working now, except for the capture source stuff...[and not sure what else i need to find that's linked to make them work in reality, oh yea,recording_extras/groups]
so far so good...Smile
and all in a batch file...hehe

i use a pvr150 setup as 2 sources for antenna and cable/svideo...
in which case the mappings would need to be to the correct source to record certain channels.
been integrating the db info into my showburner util so willl get back to this when i have my test machine setup for it...
you'll be surprised how short the batchfiles for this are...lol

main problem for me was, if you wanted to re-schedule a reoccuring, it had to be in your guide data at the time..[or how to choose it? manulal would suck]
i think he just saves the guide listing for the particular show's original 'chosen' slot cuz that info does show up in recordings and the programme guide data even tho it's out of range of the current guide's dates..
so i probably also have to save/restore that as well,maybe not tho...
trial and error..Smile
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#26
2006-10-29, 09:34 PM
Well, your project might have given me an idea for a simple importer/exporter for recordings using the priorityrecording.xml file format. I think the only addition that would be needed is to put in the capture source name. Right now it stores the capture source number, but not the name.

Anyways, sounds like you have it handled. Since you already use XRecord, you might want to check out CDK Scheduler, it's in the Scheduler menu option. But with two capture sources you might not need the priority recording ability. I've found it invaluable with one capture source and about 35 scheduled recordings to manage. Makes sure that I never miss the "must record or the wife gets mad" shows. Smile
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#27
2006-10-29, 10:46 PM
ahhh.found a snag...
channels....in the database they're stored as a manual channel# that's just a reference to the table of translations to the real channel numbers...
so i'm saving the data, then replacing the manual channel# with the actual channel numbers...when i import back in, i have to undo that, so that the channels will map bak to the correct place, as the guide will have different mappings on the new machine...
guide data isn't needed it seems, but channels are and reoccuring extras..

still tryin to figure minimum that's needed to get them back up and running, assuming you're installing on a totally different system..maybe a couple more things..and i don't think the capture source needs defining, just the channels...
[gbpvr auto-tries till it finds a tuner with the correct avail channels..iirc]

but i have the mechanisms to get just about anything i need as far as info, and write it back also...Big Grin
so just need to figure out what's required and make it happen..Smile
if anybody wants to share any knowledge about the database/reoccurings, i'd be ever so greatfull..Wink
getting there...
[btw, i'm import the recordings from one machine to a totally different one with different kinds of capture cards, even different types...[one is software recorder type,works great!] but they share same channel availability , so if it'll work here, should work anywhere..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#28
2006-10-30, 04:21 PM (This post was last modified: 2006-10-30, 05:09 PM by pBS.)
well saving with adjusted channel numbers is working, now to jsut reverse the same to enter oid's of new channels...Smile [shouldn't be that hard]
so far the re-imported ones look good...may not need a lot of the info from the columns as it seems to work with just times,channel,status,type, and name..
after a reload of the schedule, new shows popped up with the correct capture source..Big Grin
so far so good...thought that might be a snag,adjusting data as it's saved..
should be able to post something soon...after some real world testing..

import is working now and adjustments are good..!
now just to wait to see if the recordings actually happen...
they look good in the recordings screen...and after guide update the new scheduled recordings do too..cap source auto-adjusted like i thought...Big Grin wooohooo!!
[reoccurings aren't like normal recordings, they are just placeholders used as a 'template' to schedule recordings when guide is updated, so not all info is needed..GBPVR will adjust certain things auto]

all completely from a couple of batch files..muhahaha
:p
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#29
2006-10-30, 07:55 PM (This post was last modified: 2007-07-14, 09:13 PM by pBS.)
well, here ya go for you adventurous types...[BETA!]
2 batch files, one to save them, one to restore them...simple..
only saves re-occuring recordings, no new pendings will show until you update the guide...
[update it from config/cap source and it will skip download but work for this]
then you'll see the new shows in pending and notice they're adjusted for the new machine..
also, they're really meant for a clean database, as if you have say a recording with 'group 2' reoccuring type already in there, the import will create another one, that also has that group number...so not sure how that would react..
may be able to adjust those as well...[to be unique on new machine..feedback welcome]

i'm using it to transfer between 2 machines that have totally different setups, one is pvr150 and one is software recorder, both with dual inputs and different guide data sources! [one i-xmltv and one built-in zap2it] but both with same channel lineups...both antenna and svideo in on each...
recording kicked off without a hitch, so everything looks good... it knew which card to select..Big Grin

but Beware and backup your database before using this! there may be weird byproducts of this but it looks great in the database to me...just like any other re-occuring..no loss of info on recordings or anything..Smile
it creates a few temp files to do it's dirty work, but it deletes them before running again so safe to delete if you want..[*.sql]
the files you want to keep to transfer are data2.sql and extras.sql

here they are...also requires sqlite3.exe in current dir..
re-occuring saver:
EDIT: added search term so use: "save.bat dead zone" to export only shows with that in title, or nothing to export all.
Code:
@echo off
set db=\\Pvr\os\program files\devnz\gbpvr\gbpvr.db3
del /q data.sql 2>NUL
del /q data2.sql 2>NUL
del /q extras.sql 2>NUL
set show=
if "%*"=="" (
set show=%%
) else (
set show=%%%*%%
)
echo %show%
:: save reoccurings from recording_schedule to data2.sql
for /f "usebackq tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 delims=," %%a in (`sqlite3 -separator "," "%db%" "SELECT * FROM RECORDING_SCHEDULE where status='4' and recording_type='5'  and filename like '%show%';"`) do echo NULL,'%%b','%%c','%%d','%%e','%%f','%%g','%%h','%%i','%%j','%%k','%%l','%%m','%%n',NULL >> data2.sql
if not exist data2.sql goto :bad
:: save recording_extras to extras.sql
for /f "usebackq tokens=1,2,3,4,5 delims=," %%a in (`sqlite3 -separator "," "%db%" "SELECT * FROM reoccuring_extras ;"`) do echo '%%a','%%b','%%c','%%d','%%e' >> extras.sql
:: Adjust channels in data from reoccuring table, and save as data.sql for re-import.
for /f "usebackq tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 delims=," %%a in (data2.sql) do (
    for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%db%" "SELECT channel_number FROM channel where oid=%%j;"`) do (
echo adjusting oid-%%j  to ch-%%v and exporting %%e
   echo NULL,%%b,%%c,%%d,%%e,%%f,%%g,%%h,%%i,'%%v',%%k,%%l,%%m,%%n,%%o >> data.sql
   )
)
goto :Eof
:bad
echo Bad Query..Try again

re-occuring importer:
Code:
@echo off
set db=C:\Program Files\DEVNZ\Gbpvr\GBPVR.DB3
del /q dataimp.sql

:: Adjust for new channel oid's, and save as dataimp.sql for re-import.
for /f "usebackq tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 delims=," %%a in (data.sql) do (
    for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%db%" "SELECT oid FROM channel where channel_number=%%j;"`) do (
echo adjusting ch-%%j into new oid-%%v for %%e
   echo NULL,%%b,%%c,%%d,%%e,%%f,%%g,%%h,%%i,'%%v',%%k,%%l,%%m,%%n,%%o >> dataimp.sql
   )
)

:: import recordings
for /f "tokens=* delims=" %%a in (dataimp.sql) do sqlite3 -separator "," "%db%" "INSERT INTO "RECORDING_SCHEDULE" VALUES (%%a);"

:: import reoccuring_Extras
for /f "tokens=* delims=" %%a in (extras.sql) do sqlite3 -separator "," "%db%" "INSERT INTO "REOCCURING_EXTRAS" VALUES (%%a);"

goto :eof
just change the database location at top of each for your situation...
EDIT: added 2 extra new fields to database for new versions.

be carefull as its not fully tested..tho you can easily go into recordings and delete them before updating guide if it goofs..

let me know if any problems..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#30
2006-10-31, 02:50 AM (This post was last modified: 2006-10-31, 04:10 PM by pBS.)
hmmm, i'm thinking the solution to the grouping issue is to see if conflict,if so assign next higher free number as new grouping, and adjust data to that fact..
that way existing groupings will be retained, and only new reoccurings adjusted to new groupings#....[with groupings data in reoccuring_extras also adjusted]
will require many more lines but should be easily doable..

that way you could use this anytime without conflict, to share scheduling between machines like a backup recorder..Smile
i guess i could also put in a search to output only reoccurings with x in name..Big Grin Done!
that way could just transfer a single show to another machine...
[also should be easy to implement]

am i da batch-file-man or what? lol :eek:
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 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,306 2015-08-25, 10:21 AM
Last Post: puck64
  Possible to have another element in details-single.xml Northpole 2 2,206 2014-07-11, 09:51 PM
Last Post: Northpole
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,787 2014-01-02, 06:36 AM
Last Post: bgowland
  Recording export tags and export details? spinnaker 10 4,386 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,276 2013-01-26, 05:14 AM
Last Post: bgowland
  Album art. Current conventions? bgowland 2 1,589 2012-12-21, 02:08 AM
Last Post: bgowland
  Skin element Details in NowNext Jaggy 2 1,780 2011-09-19, 11:50 PM
Last Post: Jaggy
  "Rating" in cached event details xml alibert 74 16,715 2011-03-28, 01:06 AM
Last Post: zehd
  NPVR batch files mvallevand 4 3,205 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