LinHES Forums
http://forum.linhes.org/

Multiple EPG sources to one card ?
http://forum.linhes.org/viewtopic.php?f=11&t=10075
Page 1 of 1

Author:  korffr [ Tue May 16, 2006 8:55 pm ]
Post subject:  Multiple EPG sources to one card ?

Hi,

Here is my situation. There are no ready made grab scripts for the area I live in. So I have written my own. The problem is that the cable provider has free channels (that normally are 'air' based) as well as their own offering of satellite channels. However their program guide on the cable providers website only shows their satellite offerings, not the air channels.

So I have written a script for the cable provider and have written a script for one of the free channels (more still to be done) which grabs it from the broadcasters website.

When I tried to get this in mythtv I am running into a problem. I can link the card to a source, and I can link individual channels to a source.

If I link the individual channels to a source, it shows up in the mythweb listing, but when I am flipping channels it does not.

I know I could integrate the scripts and only have one source script, but that is not really what I want to do, since there are approximately 6 scripts that would need to be integrated.

Is this a bug, or is there a way around this ?


Thanks

Richard

Author:  tjc [ Tue May 16, 2006 9:03 pm ]
Post subject: 

I've done something like this (integrating data from multiple video sources into one) and posted the basic scripts around here somewhere.

Author:  korffr [ Tue May 16, 2006 9:52 pm ]
Post subject: 

tjc wrote:
I've done something like this (integrating data from multiple video sources into one) and posted the basic scripts around here somewhere.


tjc,

Sorry to bother you again, do you have any hints on which post it was (how long ago, keywords). I did some searching under author = tjc, but could not find anything immediately with search terms like : multiple sources, grab or mythfilldatabase.

Thanks,

Richard

Author:  tjc [ Tue May 16, 2006 10:23 pm ]
Post subject: 

I found this by looking for the names of the tables I had to fiddle with: http://mysettopbox.tv/phpBB2/viewtopic.php?t=6868

My script (now) looks like this:
Code:
root@black2:~/scripts# cat update_database.sh
#!/bin/bash

exec >/var/log/mythtv/update_database.log 2>&1

copy_channel () {
  from_chanid=$1
  to_chanid=$2

mysql -u root mythconverg <<EOF
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
        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
    # fill_options="--refresh-second"
    fill_options=""
fi

/usr/bin/mythfilldatabase $fill_options
sleep 5

echo ;  echo "Fixing AZNTV" ; echo
copy_channel 2251 1098

/usr/bin/mythbackend --resched

echo
echo "Database update completed"


You'll need to do something a bit more complicated (but not all that much), mapping each source to the merged one. Here chanid 2251 is channel 251 from source 2, it's being mapped to channel 98 in source 1 (the one I actually associate with my tuners). All you need is to call copy_channel for each pair.

Author:  korffr [ Tue May 16, 2006 11:02 pm ]
Post subject: 

Thanks, looks cool.

Haven't run the script yet, but am I right to say there is an 'insert into credits' missing ?

.
.
.
delete from credits
where chanid = '$to_chanid';

insert into credits
(select person, '$to_chanid', starttime, role
from credits
where chanid = '$from_chanid');
.
.
.

Author:  tjc [ Wed May 17, 2006 6:15 am ]
Post subject: 

Yeah, sorry about that. Looks like a cut & past snafu. I'll fix it for future reference.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/