[mythtv-users] power search with maths (program duration)

Tim Draper veehexx at zoho.com
Mon Sep 21 07:06:01 UTC 2015



---- On Sat, 19 Sep 2015 10:38:57 +0100 Jan Ceuleers<jan.ceuleers at gmail.com> wrote ---- 
 > On 19/09/15 10:42, Tim Draper wrote: 
 > > I'm trying to setup a power search to only record the 1hour showings of a program. having taken a look in at the db via phpmyadmin, there does not appear to be a specific column with duration. I assume to calculate the duration, i need to subtract 'starttime' from 'endtime' from the program table. 
 > >  
 > > This is where i have issues. Not being familiar with sql or building queries, how would i do this? 
 >  
 > TIMESTAMPDIFF(MINUTE, program.starttime, program.endtime) can be 
 > compared to the desired number of minutes. For example 
 >  
 > TIMESTAMPDIFF(MINUTE, program.starttime, program.endtime) <= 65 
 >  
 > catches programs that last up to an hour and five minutes. 
 > _______________________________________________ 
 > mythtv-users mailing list 
 > mythtv-users at mythtv.org 
 > http://lists.mythtv.org/mailman/listinfo/mythtv-users 
 > http://wiki.mythtv.org/Mailing_List_etiquette 
 > MythTV Forums: https://forum.mythtv.org 
 > 

thanks for the help - my full rule now looks like which is excluding the 30/40 minute version and catching the the 1h/1h5mins showing - hope it helps someone else in the future... 

program.title LIKE 'Program Name' AND TIMESTAMPDIFF(MINUTE, program.starttime, program.endtime) BETWEEN 55 AND 65



More information about the mythtv-users mailing list