
bjm at lvcm
Feb 12, 2008, 3:15 PM
Post #2 of 2
(228 views)
Permalink
|
|
Re: [mythtv-commits] mythtv commit: r15955 by bjm
[In reply to]
|
|
Janne Grunau wrote: > On Tuesday 12 February 2008 22:26:48 mythtv [at] cvs 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 >> >> Modified: >> >> branches/release-0-21-fixes/mythtv/libs/libmythtv/customedit.cpp >> >> Log: >> >> 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 > HOWTO. 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. -- bjm <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: <tscreen><verb> "FIND_IN_SET('SURROUND', program.audioprop) > 0" </verb></tscreen> would be true for the programs where the surround sound bit is present. To see all of the available attribute names: <tscreen><verb> $ mysql -u mythtv -pmythtv mythconverg mysql> SHOW COLUMNS FROM program LIKE '%prop'\G mysql> SHOW COLUMNS FROM program LIKE 'subtitletypes'\G </verb></tscreen> _______________________________________________ mythtv-dev mailing list mythtv-dev [at] mythtv http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
|