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

Jan Ceuleers jan.ceuleers at gmail.com
Sat Sep 19 09:38:57 UTC 2015


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.


More information about the mythtv-users mailing list