Volleynerd Knowledge Base |
Volleynerd's Things to Remember
Hot TopicsFirefox Extensions
DVD issues (latest)
Site Feed (Atom) Archives here
|
Thursday, July 17, 2003
Personal ReplayGuideCombination of XMLTV, Perl scripts, SQL Server (or MySQL), ReplaySchedule.exe and web pages to create list of shows, recordings, and allow scheduling of recordings on Replay 5000-series.Trying to get all this working on my Windows XP box, running SQL Server 2000. Since based on Perl, had some things to learn when installing. First some links:
NOTE: See Perl Monks for good starting tutorial information on Perl. Installation notes See Install.txt with ReplayGuide for info on installation steps. Using SQL Server, so followed those steps. Had some trouble with XMLTV, needed latest version since apparently zap2it has changed their xml feed. Using XMLTV 0.5.15 from SourceForge.net, along with v115.19 of replaySchedule.exe (see below for links) xmltv tv_grab_na --configure xmltv tv_grab_na --days 7 > na.xml (update number of days - grabbing 7 here) perl choked on the DBI stuff. poked around on the web and found to install the other modules you have to do this through Perl "PPM interactive shell": ppmThis goes out to web somewhere and downloads the DBI modules and installs them. Use query command in PPM to see what modules you have. Ran install DBD::ODBC as well to setup the module for ODBC / SQL Server. Some things that had to change to get things working:
Some info from author and others at avsforum in this LONG thread (look for responses to my volleynerd post on 7/23)
Embedded Database Calls Final fix to get things to work was to handle the embedded db calls. See my post for details on the problem. Basically, there is an outer loop that walks the tvlistings for the given time frame. Then for each show, a function is called to get the program details, which makes another SQL stmt. Apparently, the combination of some db drivers with some perl db packages don't allow for multiple SQL stmts to be open at once. The fix: Added a SECOND dsn in the StartDSN function, and close it down in the EndDSN. Use this DSN name ($DSNLink2) in the inner loop when getting show details. See the thread quoted above for more info - the author and others say this 2nd DSN may not be necessary -- either use tweaked scripts (newer than the 187 version I have), or updated db drivers and perl db packages. SWEET!! I finally see the tv listings grid --- and it shows any recordings currently scheduled. Scheduling Recordings Ugh...now it's on to the recordings page - getting "slot not available" on all requests. Permissions problem? Well even pasting the big URL into the interactive browser returns same answer - 0 slots. Wahoo - got recordings working Well, first off, I didn't realize that you needed to enter a show title in the proper field. The Replay box ends up doing a "search" on this information (including the time, etc) for a matching show (aka "slot"). If you just put garbage in the title field, you get "no slots available". Only problem now was my channel lineup of 2-555 and then the 1000-series of the straight cable channels. At first, the second set of channels was not showing up for basic searches like "Today" show. Found problem in the schedule.pl file, ~line 420 (added some of my own debug lines, so line #s are prob off a bit). do...while loop for me needs to be from 1 to and including n_slots do...while ( c_slot <= n_slots ) Sweet! Now I get both 7 and 1007 channels listed as matching the query, and they both work for setting the channel. Next task: how to cancel a recording. Before that, need to get 1000-series channels correctly displaying in TO-DO list Some background: My replay unit has two sets of channels from the two inputs. 2-555 are coming from the digital cable box. 1002-1115 are coming straight from the coax from the wall. (This setup allows me to record most channels [non digital/scrambled] off the second set (1000-series) and then watch tv through the digital cable box at the same time. The issue: even when a recording is scheduled on a 1000+ channel, it would always show up in the PRG as in the 2-555 channels. The goal: give an indication that a given recording is coming from what actual channel, the 2-555 or the 1000+ channels. Grabbed ReplaySchedule.exe source code, and checked it out. How things work: ReplaySchedule gets the data from the Replay unit, then looks for matches in the channels and descriptions from the XMLTV output xml file. The data from the Replay box has the "internal" channel numbers (including 1000+), but this info is lost when taking most of the "matching data" from the XMLTV output file. This data is then stored in the SQL DB, then used to display the channel, etc. for the recording. So...even when the recording is for say channel 1008, the PRG recording listing shows "KFMB 8". With minor code changes, I was able to grab the "internal" channel number from the replay guide data, and output it in the ReplaySchedule output. (See ReplaySchedule.c, look for //dhdh comments). Basically added a member to the "channel" structure to store the internal channel, then propogate that int through the copies, and outputs. DB change: added "internalChannel" to schedule table. int 4, allow NULLS. Change to schedule2sql.pl (look for "dhdh"). In open(<LISTINGS>), use regex just like other lines to pull out the internalChannel attribute from ReplaySchedule.exe xml output. In PostSQL, add the internalChannel column to the insert stmt. Note Posted 10:48 PM | 0 comments | Permalink ![]()
Comments:
Post a Comment
|