[mythtv-users] Filtered lists of films

Richard Hulme peper03 at yahoo.com
Sat Apr 16 10:14:18 UTC 2016


On 14/04/16 15:40, Jeffrey Ratcliffe wrote:
> On 14 April 2016 at 14:54, Dan Wilga
> <mythtv-users2 at dwilga-linux1.amherst.edu> wrote:
>> On 4/14/16 5:01 AM, Jeffrey Ratcliffe wrote:
>> In a general sense it's not possible at all, due to the fundamental way
>> MythTV works. When you are browsing upcoming titles in the schedule, they
>> have not yet been marked for future recording. It's only when something has
>> been scheduled to record that Myth decides which tuner (input) to use to
>> record it.
>
> I have expressed myself badly.
>
> I have one tuner connected to one LNB pointed at one satellite and one
> at another, and so each tuner receives completely different channels.
>
> Perhaps what I want is achievable with input groups or filtering by
> video source.

It can be done but requires getting your hands dirty and writing an SQL 
query.

You can create the SQL query in the 'Custom Record' screen and then 
select 'Store' instead of 'Record'. After that you can see upcoming 
matches under 'Search listings->Stored Searches' and choosing your 
query. Pressing '2' in that screen will sort the results by title so you 
only see one entry for each title. If you mark a film to record, it 
usually makes sense to choose 'Record one showing' then Myth can decide 
itself which showing to record.


The shortest and easiest SQL query will vary depending on your setup.

If all the channels on each input are within a self-contained range of 
channel numbers (e.g. 1-99 for LNB 1, 100-199 for LNB 2), something like 
the following is quite straightforward:

program.chanid = channel.chanid AND channel.channum BETWEEN 1 AND 99 AND 
program.category_type = 'movie'

If the channels are mixed together, you could bring in the 'videosource' 
table.  You need to add ",videosource" to the 'Additional tables' field 
and change the query to something like:

program.chanid = channel.chanid AND videosource.sourceid = 
channel.sourceid AND videosource.name = '<your video source name>' AND 
program.category_type = 'movie'

Depending on your guide data you may need to alter the query to match 
just films.


You can also look at some of the sample clauses in the 'Custom Record' 
screen to get some ideas on how to tweak the query to your liking.  For 
example, you may want to restrict the query results to certain channels, 
so maybe you want to search based on channel names (channel.name LIKE 
'BBC%' OR channel.name LIKE 'ITV%').

One thing I've found useful was to add

AND NOT EXISTS (SELECT programid FROM oldrecorded WHERE 
program.programid = programid AND recstatus=-3)

This filters out entries that have already been recorded at some point 
in the past and not been marked 'Allow re-record').  Obviously this 
assumes that your guide data contains reliable programids but it could 
be tweaked to match on title/subtitle.


Obviously the queries *can* get complicated and so aren't for everyone 
but they do allow you get exactly what *you* want.

Richard




More information about the mythtv-users mailing list