[mythtv-users] Fwd: Is it possible to group channels ?

Dave dave at 0bits.com
Mon Feb 12 10:01:55 UTC 2007


For anyone interested i've figured out how to do this. It's actually 
quite trivial to do this via the method described below, but it'd be 
nice to have this as part of the stock mythconverg schema.

So without having to edit databases, the steps to do it is as follows:


1. Connect to the database and figure out what channels you want to 
watch. Something like so

  mysql -s -e 'select chanid,name from channel'  mythconverg >all.txt

will list all the channels. Then write down the names of all channel 
id's that you want to group in the individual users and create separate 
files like 'wife.chan' 'kids.chan' 'sports.chan' with single lines with 
channels you want in that bouquet and store that somewhere 
(/home/mythtv/scripts for example)

2. Write a script like so (make sure you have the password for mysql 
user set in /etc/my.cnf or .my.cnf so you don't have to provide the 
password and can do changes from a script).

#!/bin/bash
CPATH=/home/mythtv/scripts
SQL=$CPATH/sql.txt

if [ -f $CPATH/$1 ]; then
  echo "start transaction;" >$SQL
  echo "update channel set visible=0;" >>$SQL
  while read chan desc
  do
   echo "update channel set visible=1 where chanid=$chan;" >>$SQL
  done  < $CPATH/$1
  echo "commit;" >>$SQL
  mysql mythconverg <$SQL
fi


3. Just write a UI menu for this. Edit (back this up first)

  /usr/share/mythtv/tvmenu.xml

and add

    <button>
       <type>TV_SCHEDULE</type>
       <text>Kids channels</text>
       <action>EXEC /home/mythtv/switchchannel  wife.chan</text>
    </button>

or use a remote button to do the same thing using 'irexec' if you don't 
want this in a menu or you want channels visible that are not suitable 
for the family.

Works very well for me !!!


-------- Original Message --------
Subject: Is it possible to group channels ?
Date: Wed, 07 Feb 2007 00:56:22 +0400
From: Dave <dave at 0bits.com>
To: mythtv-users at mythtv.org

Hi,

Just moved to Mythtv from a dreambox and struggling a bit. I've got 3
dishes with a Diseqc switch. Now having Hotbird, Nilesat and Pan7/10 i
have quite a few hundred channels (in the range of 1000 including
audio), of which i only watch or browse thru 50 or so. My kids another
10, and the wife a smaller set.

Here's the problem. With the dreambox you could set up bouquets
(corresponding in my case to each member of the family) but i can't see
how to do this.

I can delete all my unwanted channels in myth, but i still end up with
~100 channels that we're watching/flicking thru. With Mythtv this is a
extremely tedious task going thru all the channels to find the one i
want. So, i know i can add a xml menu to show "kids", "wife" and "my"
WatchTV channels, but how do i associate a ste of channels to be
browseable for each person ?

Is this possible or am i asking too much ? Someone out there must have a
similar requirement and asked the same question before ?

Thanks for any advise
Dave



More information about the mythtv-users mailing list