[mythtv] [mythtv-commits] mythtv commit: r15955 by bjm
bjm at lvcm.com
Tue Feb 12 23:15:35 UTC 2008
Janne Grunau wrote:
> On Tuesday 12 February 2008 22:26:48 mythtv at cvs.mythtv.org wrote:
>> Author: bjm
>> Date: 2008-02-12 21:26:48 +0000 (Tue, 12 Feb 2008)
>> New Revision: 15955
>> Changeset: http://cvs.mythtv.org/trac/changeset/15955
>> Follow up to janne's 'program' table property fixes. Change
>> customedit examples to use FIND_IN_SET() instead of the raw
>> bit numbers.
> Thanks Bruce,
> updating this rules was on my todo list but I could not decide
> whether "FIND_IN_SET('X', set)" or "set LIKE '%X%' is less ugly.
> FIND_IN_SET is preferable since it won't match on substrings.
I think the function has more characters but much easier to
understand for non-programmers. A question I've always had
is; can aunt Maggie use Custom Record? Well, no but I like
to think it could be useful for literate computer users with
little or no programming experience. The point of having
examples with readable names is that people ought to be able
to use these like Logo blocks and they can see where they would
need to change a number or string if necessary. Ultimately it
might go good to have another interface similar to mail filters
where the user just clicks to add and remove clauses without
seeing the raw guts.
>> The HOWTO will have more info on using sets.
> "SHOW COLUMNS FROM program LIKE 'videoprop';" will show the valid values
> for the set but it might be enough to mention the current values in the
This one I was debating. I could list the current sets but
if they change it may be wrong for a while and/or the
list might be different from one myth version to the next.
So, in this second draft, I included how to look them up. A
bigger concern is getting someone's hopes up only to later
find that their grabber doesn't flag the attribute they were
hoping to test for.
<item>"program.videoprop" also "audioprop" and "subtitletypes".
These columns contain bit flags for a variety of attributes that
may be associated with a program. These are filled with information
offered by the TV listings provider. However, your listings source
will not have information for all of the available flags. Therefore,
some of these may not be useful for your search rules. This information
is organized in "sets" and the MySQL function FIND_IN_SET() can be used
to test for any of these flags. For example:
"FIND_IN_SET('SURROUND', program.audioprop) > 0"
would be true for the programs where the surround sound bit is present.
To see all of the available attribute names:
$ mysql -u mythtv -pmythtv mythconverg
mysql> SHOW COLUMNS FROM program LIKE '%prop'\G
mysql> SHOW COLUMNS FROM program LIKE 'subtitletypes'\G
More information about the mythtv-dev