[mythtv] keyword-based recording

Bruce Markey bjm at lvcm.com
Sun Jan 9 03:58:47 EST 2005


Bruce Markey wrote:
> Chris Petersen wrote:
> 
>> Would someone like to explain to me how this works db-wise, so I can 
>> get it added to mythweb?  Does it support regex, etc?
> 
> 
> Sure, if record.search > 0 then the secheuler knows it is a search
> rule. The types can be found in ./libs/libmythtv/recordingtypes.h.
> 
> 0 is kNoSearch
> 1 is kPowerSearch
> 2 is kTitleSearch
> 3 is kKeywordSearch
> 4 is kPeopleSearch
> 
> For Title, Keyword and People the string for matching is
> stored in the record.description field. When the scheduler
> uses one of these, it surronds them with "%" so "Junkyard%Wars"
> for a kTitleSearch becomes "LIKE '%Junkyard%Wars%'". PowerSearch
> is a little different in that it expects the actual SQL that is
> to be plugged into the WHERE clause of scheduler's SQL query.
> Custom Record and Advanced Search use this type.

Left out a couple things and probably should cut to the chase
for specifically what you want to do.

The matches are case insensitive. '%' is the wildcard character.
The Keyword type looks for the phrase in any of title, subtitle
and description. The People type looks in some other tables
(people and credits) that currently are only populated by DD so
this won't work for other grabbers.

To set a Search rule for Title, Keyword or People, you'll want to
set these fields. By convention, the title should be in the form
'<phrase> (<type> Search)'. Description is '<phrase>' and 'search'
is the search type int. The times should all be the current time
so that they aren't left blank. The only valid record types are
FindOne (6) and All (4).

So a record all Junkyard [Mega]Wars example would look like this:

         type: 4
       chanid: 0
    starttime: 00:28:06
    startdate: 2005-01-09
      endtime: 00:28:06
      enddate: 2005-01-09
        title: Junkyard%Wars (Title Search)
     subtitle:
  description: Junkyard%Wars
       search: 2

...and allow for setting all the other options like profile,
recgroup, start/end offsets, expire options and duplicate
options just like any other record rule.

--  bjm


More information about the mythtv-dev mailing list