[mythtv] GetProgramGuide does not return the good program list

Chase Douglas chasedouglas.lists at gmail.com
Wed Sep 17 19:09:40 UTC 2008


On Sep 17, 2008, at 2:19 PM, Michael T. Dean wrote:
> 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).

I would argue that this patch should definitely go into -fixes. The  
workaround is slower requiring many more mythxml retrievals (this is  
actually an issue on the iPhone). Aside from that, the workaround  
isn't a full workaround. What I've got MyMote doing right now as a  
workaround is to ask for 6 hrs of programming. If there are any holes  
at the beginning or end, then we try to retrieve all the programs on  
that channel from 24 hrs before or 24 hrs after. The real problem is  
what happens when a show is 7 hours long and spans the total 6 hrs  
requested. In this instance, mythxml doesn't tell us about the  
program, and since there is no other program on the channel at that  
time, mythxml doesn't report the channel itself either. So now we  
don't have anything to go on as we don't know that a channel without  
program information exists. This can also occur anytime there are only  
two programs where one starts before the 6 hr window and the other  
ends after the 6 hr window.

What would be the harm in putting it in -fixes anyways? It's clearly  
the correct code and should be rather innocuous. You can still use the  
workaround, just as I do in MyMote, but the check for any missing  
programs comes up empty. No harm done.

Thanks,
Chase


More information about the mythtv-dev mailing list