LinHES Forums http://forums.linhes.org/ |
|
Attempting to merge two Zap2It listings to one EPG for use http://forums.linhes.org/viewtopic.php?f=11&t=14845 |
Page 1 of 1 |
Author: | bigbro [ Sat Apr 07, 2007 4:15 pm ] |
Post subject: | Attempting to merge two Zap2It listings to one EPG for use |
I have created this to migrate a previous discussion posted in the wrong forum thread. Referenced here but do not post in there: http://mysettopbox.tv/phpBB2/viewtopic.php?p=87116 I have closed that forum by referencing a link to this new Forum. Here is the last posting we had done for reference. From TJC> Try this version. It should be a bit closer to right... Code: #!/bin/bash LOG_FILE="/var/log/mythtv/update_database.log" mv -f $LOG_FILE $LOG_FILE.old exec >$LOG_FILE 2>&1 copy_channel () { from_chanid=$1 to_chanid=$2 # You really only need to copy the channel table data over once, but # it shouldn't hurt anything to do it every time. I could probably # make this smarter about that... mysql -u root mythconverg <<EOF delete from channel where chanid = '$to_chanid'; insert into channel (select '$to_chanid', channum, freqid, sourceid, callsign, name, icon, finetune, videofilters, xmltvid, recpriority, contrast, brightness, colour, hue, tvformat, commfree, visible, outputfilters, useonairguide, mplexid, serviceid, atscsrcid from channel where chanid = '$from_chanid'); delete from program where chanid = '$to_chanid'; insert into program (select '$to_chanid', starttime, endtime, title, subtitle, description, category, category_type, airdate, stars, previouslyshown, title_pronounce, stereo, subtitled, hdtv, closecaptioned, partnumber, parttotal, seriesid, originalairdate, showtype, colorcode, syndicatedepisodenumber, programid, manualid, generic, listingsource, first, last from program where chanid = '$from_chanid'); delete from credits where chanid = '$to_chanid'; insert into credits (select person, '$to_chanid', starttime, role from credits where chanid = '$from_chanid'); delete from programgenres where chanid = '$to_chanid'; insert into programgenres (select '$to_chanid', starttime, relevance, genre from programgenres where chanid = '$from_chanid'); delete from programrating where chanid = '$to_chanid'; insert into programrating (select '$to_chanid', starttime, system, rating from programrating where chanid = '$from_chanid'); commit; EOF } fill_options="$*" if [ -z "$fill_options" -o "$fill_options" = "--quiet" ] ; then if [ $(date +%A) == "Sunday" ] ; then fill_options="--refresh-all" else # fill_options="--refresh-second" fill_options="" fi fi /usr/bin/mythfilldatabase $fill_options sleep 5 # Give the DB time to settle. # We can add as many mappings here as needed. echo ; echo "Merging lineups" ; echo copy_channel 2251 1098 # This only needs to be done once at the end. /usr/bin/mythbackend --resched echo echo "Database update completed" exit 0 Updated I have ran this script but it still will not let me schedule from the second source. I had to leave at this point last week, while away a new issue has cropped. If there are any details I can provide let me know. I just wanted to get this started again as I am able to work on it again and would like to get some of this resolved.[/code] |
Author: | bigbro [ Tue Apr 10, 2007 9:41 pm ] |
Post subject: | Updated Info |
I resolved the other issue I mentioned. Now here is what I am getting from the merged Channels scripts. I can see them in the Program Guide, I can perform searches to find shows on them. I can even select a unique program and setup a schedule to record that show. However, the selection never transitions to my Upcoming recordings and thus never records. The orginal listing I am taking the merge from works as I can set one of my Tuners to only have that as a listing source and I have scheduled recordings from those channels on it fine. But that essentially makes me run with 3 tuners pointing to one Db and 1 pointing to the other. I haven't tried to see if running that way would resolve some of the conflicts, my guess is it might but would present others. TIA. |
Author: | alien [ Wed Apr 11, 2007 2:35 am ] |
Post subject: | |
I think I might have something similar. I have both digital and analog cable. There is some overlap on the available channels, but both have some channels not available on the other. I have set up a source for each and put in the channels available. I have also set up the xmlids appropriately. Finally, I have selected the "Hide channels without channel number" option. I then set up the grabber to grab the superset of all channels for both sources. I run it directly and save the results to an xml file (actually two xml files since I have to use both tv_grab_de_tvtoday and nxtvepg to get all channels available). Finally, I run mythfilldatabase with the -f option to take the data from the xml files. I run it on both sources. Each source gets populated. All channels that do not exist in that source get automatically created without a channel number and remain hidden, so I never know they are there. Basically, I run all the channels into both sources, but the "unavailable" onces are left without a channel number and remain hidden. |
Author: | bigbro [ Wed Apr 11, 2007 7:12 pm ] |
Post subject: | |
Sounds similar but we use different grabber methods for getting channels and all of my channels come from Satellite dishes. Here is what I have found so far. I can look at the mysql channel table data. the second source channels are listed in there and appear to be correct. I can go to the program guide via mythweb and they are there, I can see them in searches and when I try to schedule specific programs on them. However, they never transition to "Scheduled" programming. Additionally, if I am viewing TV and pull up the Program Guide they "do not" show up as available channels to tune. If I try to schedule programming on the TV through the Mythweb frontend those channels "do not" show up as available sources to schedule programming from. So in essence it seems we are about half way there. They are in the Database I just need to figure out how to get the Frontend to recognize them. Andy |
Author: | alien [ Thu Apr 12, 2007 4:07 am ] |
Post subject: | |
bigbro wrote: Sounds similar but we use different grabber methods for getting channels and all of my channels come from Satellite dishes.
I believe all the grabbers have an export to xml option. I think there is even one to export DVB EPG xml files. The grab to file solution might still work for you and save messing directly with the DB. First you would manually create two configs: Code: tv_grab_na --configure --config-file /home/mythtv/config.a [enter options for first location] tv_grab_na --configure --config-file /home/mythtv/config.b [enter options for second location] Then, the script would look something like (note, you will have to check the man pages to get the options right, I'm typing this off the top of my head): Code: #!/bin/sh
tv_grab_na --config-file /home/mythtv/config.a --file /tmp/a.xml tv_grab_na --config-file /home/mythtv/config.b --file /tmp/b.xml mythfilldatabase --file 0 0 /tmp/a.xml mythfilldatabase --file 0 0 /tmp/b.xml You could then set up a daily cron job to run this each night. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |