[mythtv] GetProgramGuide does not return the good program list

Michael T. Dean mtdean at thirdcontact.com
Wed Sep 17 18:19:39 UTC 2008

On 09/17/2008 01:38 PM, Xavier Hervy wrote:
> Paul Harrison wrote:
>> xavier hervy wrote:
>>> After reading the mythxml.cpp source code , I believe the function
>>> GetProgramGuide does not return the right subset of programs.
>>> the function use the following parameters StartTime, EndTime,
>>> NumOfChannels, StartChanId and Details
>>> At the moment the function return the programs which start at or after
>>> "StartTime" and finish before or at "EndTime"
>>> 543 QString sSQL = "WHERE program.chanid >= :StartChanId "
>>> 544                "AND program.chanid <= :EndChanId "
>>> 545                "AND program.starttime >= :StartDate "
>>> 546                "AND program.endtime <= :EndDate "
>>> 547                "GROUP BY program.starttime, channel.channum, "
>>> 548                "channel.callsign, program.title "
>>> 549                "ORDER BY program.chanid ";
>>> To build a programs guide, I would expect the function to return the
>>> program guide between StartTime and EndTime for the channel StartChanId
>>> and the following (NumOfChannels-1) channel(s). 
>>> Including:
>>> programs which start before Starttime and finish after EndTime
>>> programs which start at or after Starttime and start before EndTime
>>> programs which ends after Starttime and finish at or before EndTime
>>> as bellow:
>>> WHERE program.chanid >= :StartChanId 
>>> AND program.chanid <= :EndChanId 
>>> AND ( 
>>> ( program.starttime <= :StartDate AND   program.endtime >= :StartDate ) 
>>>   OR 
>>> ( program.starttime >= :StartDate AND   program.endtime > :StartDate )
>>>  OR 
>>> ( program.starttime < :EndDate AND program.endtime <= :EndDate ) 
>>> )
>>> GROUP BY program.starttime, channel.channum, 
>>> channel.callsign, program.title 
>>> ORDER BY program.chanid 
>>> Do I miss something obvious or should I open a trac ticket and submit a
>>> patch ?
>> There's already a ticket open for this. 
>> http://cvs.mythtv.org/trac/ticket/4956.
> I should search before ...
>> Maybe you could test the patch there and report if it works as you would 
>> expect which would help whoever eventually decides to look at this.
> Seems to do the same but in a more simple way. I should study boole's 
> logic a bit more :)
> I will try and report on it...

Note, also, that patch won't go into -fixes, so if you're trying to use 
this for a client that you want to work with 0.21-fixes, you should read 
http://www.gossamer-threads.com/lists/mythtv/dev/341118#341118 (and the 
rest of that thread and the post linked from that post).

And, even if the patch did go into -fixes, you'd have to find a way to 
tell all your users that they need 0.21-fixes after a specific SVN 
revision, which will be a huge mess of confusion for you and your 
users.  Therefore, the best bet is to use the "old" approach for 
0.21-fixes and the "new" (post patch) approach (assuming the patch is 
applied) for 0.22+.  The MyMote developer was able to do this without 
problems (and is working on a resource-constrained device, so it should 
work on your client, too).


More information about the mythtv-dev mailing list