[mythtv-users] Custom Record help, please
bjm at lvcm.com
Wed Dec 13 05:41:33 UTC 2006
John P Poet wrote:
> I want to craft a custom record rule which will match Crime and
> Mystery dramas. I do *not* want reality crime shows.
> Looking through some of the shows I would like it to match, I see:
> Category: Crime, Drama
> Category: Crime drama
> Category: Mystery, Drama
> Category: Crime drama, Mystery
If you want all "Crime drama" then "Crime drama, Mystery"
is moot. Based on the above:
Category: Crime drama
Category: Drama, (Crime OR Mystery)
> Among the shows I do *not* want it to catch, I see:
> Category: Mystery
> Category: Crime
> I have tried to craft a rule which looks for either Mystery|Crime
> *and* Drama, but it does not work. Can someone give me an example of
> how to do this?
The problem is that when you JOIN, there is a result row with
the show and one specific match from the programgenres. Therefore
you need two joins of the table to come up with a combination
of two genre matches for the same show.
Rule Name: Crime Drama
LEFT JOIN programgenres ON program.chanid = programgenres.chanid AND program.starttime = programgenres.starttime LEFT JOIN programgenres genre2 ON program.chanid = genre2.chanid AND program.starttime = genre2.starttime
programgenres.genre = 'Crime drama'
OR (programgenres.genre = 'Drama'
AND (genre2.genre = 'Crime' OR genre2.genre = 'Mystery'))
I get way too many results to use as a rule so you may want
to store this to run it periodically then choose individual
series and movies. Enter the mess above then press "Store".
On the dialog page click 'Store "Crime Drama"'. Each time
you enter the custom editor you can press the left arrow to
get to "Crime Drama (stored example)", click "Add..." then
"Test" to see the current result.
That said, here is a less messy but less complete approach.
"Category" is simply the 'best' genre from the DD genre info.
Therefore, if you really want these Category plus sub-genre:
Category: Crime drama
Category: Crime, Genre: Drama
Category: Mystery, Genre: Drama
LEFT JOIN programgenres ON program.chanid = programgenres.chanid AND program.starttime = programgenres.starttime
program.category = 'Crime drama'
OR ((program.category = 'Crime' OR program.category = 'Mystery')
AND programgenres.genre = 'Drama')
Attached is the SQL to insert these into your 'customexample'
table along with a couple other useful stored examples.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the mythtv-users