Mailing List Archive

Myth Protocol Command to List Programs
I want to be able to get a list of programs from the database for a
particular channel. Rather than query the database directly, I was
hoping that there was a Myth Protocol command do it. However, I can't
seem to find one. Does one exist?

Ian.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
On Fri, 2008-03-14 at 09:50 +0000, Ian Barton wrote:
> I want to be able to get a list of programs from the database for a
> particular channel. Rather than query the database directly, I was
> hoping that there was a Myth Protocol command do it. However, I can't
> seem to find one. Does one exist?

Not that I know of, but if you added one, you could start with the
GuideGrid::GetProgramList() method. Maybe just add that to the
protocol so that guidegrid.cpp could use it as well.

-- Daniel

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
On Mar 14, 2008, at 2:50 AM, Ian Barton wrote:

> I want to be able to get a list of programs from the database for a
> particular channel. Rather than query the database directly, I was
> hoping that there was a Myth Protocol command do it. However, I can't
> seem to find one. Does one exist?

Not sure about the Myth Protocol, but you should be able to get the
information you need with the MythTV perl bindings. MythTV::Program is
a good place to start if you want to go that route.

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
On 03/14/2008 05:50 AM, Ian Barton wrote:
> I want to be able to get a list of programs from the database for a
> particular channel. Rather than query the database directly, I was
> hoping that there was a Myth Protocol command do it. However, I can't
> seem to find one. Does one exist?

I was actually just discussing this on IRC with Chris Petersen
(MythWeb/Perl bindings guy) who wanted the same. I was planning to make
a couple of changes to allow testing whether this would actually work
and scale. Once I get the modifications done, I'll post the patch so
you can test it, too.

Mike
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
Michael T. Dean wrote:
> On 03/14/2008 05:50 AM, Ian Barton wrote:
>> I want to be able to get a list of programs from the database for a
>> particular channel. Rather than query the database directly, I was
>> hoping that there was a Myth Protocol command do it. However, I can't
>> seem to find one. Does one exist?
>
> I was actually just discussing this on IRC with Chris Petersen
> (MythWeb/Perl bindings guy) who wanted the same. I was planning to make
> a couple of changes to allow testing whether this would actually work
> and scale. Once I get the modifications done, I'll post the patch so
> you can test it, too.
>
> Mike


Mike,

Would this interface allow getting details for a single program that you already
had some limited amount of information on (say title and subtitle)?

The mvpmc device has limited ram, and has memory issues when attempting to cache
all of the details for 500+ recorded programs, so if we could just keep a much
smaller amount of details for all of the 500 and then query to fill in the other
information as needed for a single program that would solve the memory issue and
allow it to deal with large numbers of programs.

We cannot really query all and just take the one we need because the query all
really takes too long when you have a large number of programs.

Roger
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
On 03/14/2008 11:34 AM, Roger Heflin wrote:
> Michael T. Dean wrote:
>
>> On 03/14/2008 05:50 AM, Ian Barton wrote:
>>
>>> I want to be able to get a list of programs from the database for a
>>> particular channel. Rather than query the database directly, I was
>>> hoping that there was a Myth Protocol command do it. However, I can't
>>> seem to find one. Does one exist?
>>>
>> I was actually just discussing this on IRC with Chris Petersen
>> (MythWeb/Perl bindings guy) who wanted the same. I was planning to make
>> a couple of changes to allow testing whether this would actually work
>> and scale. Once I get the modifications done, I'll post the patch so
>> you can test it, too.

After getting a good start on the patch today, I'm putting this on hold
for now. When discussing the patch on IRC, we've begun to consider
making this information available only through the XML server or through
the Myth protocol, but not both (though no decisions have been made,
yet--or, at least, I haven't been informed if they have :).

Since the code to make the information available through XML is already
available, it's quite likely to "win" if the devs decide to go with a
single interface.

You can play with the XML stuff using:

wget
'http://localhost:6544/Myth/GetProgramGuide?StartTime=2008-03-15T12:00:00&EndTime=2008-03-15T14:00:00&NumOfChannels=1&StartChanId=1021&Details=0'
-O listings.xml

to get a "summary" version or

wget
'http://localhost:6544/Myth/GetProgramGuide?StartTime=2008-03-15T20:00:00&EndTime=2008-03-15T23:00:00&NumOfChannels=1&StartChanId=1021&Details=1'
-O listings-detail.xml

to get all program details.

Ian, if you're hoping to get it through the Python bindings, you may
need to add bindings support for querying/parsing the XML data.

See also contrib/development/MythXMLTest/ (I'm pretty sure in
0.21-fixes, it's just under the contrib directory) for more details on
the XML interface. David Blain (and a few others) has put a /lot/ of
good stuff in there that's not really being used, yet, though doing so
would be a /very/ good thing. Much better than direct DB queries, at
least. :)

> Would this interface allow getting details for a single program that you already
> had some limited amount of information on (say title and subtitle)?
>

Looks like you can with the XML interface.

> The mvpmc device has limited ram, and has memory issues when attempting to cache
> all of the details for 500+ recorded programs, so if we could just keep a much
> smaller amount of details for all of the 500 and then query to fill in the other
> information as needed for a single program that would solve the memory issue and
> allow it to deal with large numbers of programs.
>
> We cannot really query all and just take the one we need because the query all
> really takes too long when you have a large number of programs.
>

Using GetProgramGuide and specifying a single channel ID and appropriate
start/end time*** you can limit the info you're dealing with. And, with
the "summary" info, you can really cut back on memory usage. There's also:

wget
'http://localhost:6544/Myth/GetProgramDetails?StartTime=2008-03-15T20:00:00&ChanId=1021'
-O program_details.xml

if you want to start with the summary and then fill in details on an
as-needed basis.

Now, whether XML parsing will work sufficiently fast for the mvpmc is a
whole different question. I'll leave it to you to figure that one out.

Mike

***I just posted a ticket (#4956 -
http://svn.mythtv.org/trac/ticket/4956 ) with a patch that modifies
GetProgramGuide to return any show that overlaps the StartTime and
EndTime. For example, Lost was on from 21:00 to 22:02. Before the
patch, a query for ProgramGuide with between 21:00 and 22:00 would not
return info for Lost. With the patch, the info would be returned. And,
before the patch, a query with StartTime = EndTime would return
nothing. After the patch, a query with StartTime = EndTime =
2008-03-13T21:00:00 would give 2 episodes of Lost--the previous week's
episode that ended at 21:00 and the current week's episode that starts
at 21:00. Therefore, the patch gives all the info you might need and
allows you to trim, rather than giving most of the information and
making you continue querying to get the rest.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
Re: Myth Protocol Command to List Programs [ In reply to ]
> Since the code to make the information available through XML is already
> available, it's quite likely to "win" if the devs decide to go with a
> single interface.
>
> You can play with the XML stuff using:
>
> wget
> 'http://localhost:6544/Myth/GetProgramGuide?StartTime=2008-03-15T12:00:00&EndTime=2008-03-15T14:00:00&NumOfChannels=1&StartChanId=1021&Details=0'
> -O listings.xml
>
> to get a "summary" version or
>
> wget
> 'http://localhost:6544/Myth/GetProgramGuide?StartTime=2008-03-15T20:00:00&EndTime=2008-03-15T23:00:00&NumOfChannels=1&StartChanId=1021&Details=1'
> -O listings-detail.xml
>
> to get all program details.
>
> Ian, if you're hoping to get it through the Python bindings, you may
> need to add bindings support for querying/parsing the XML data.
>
> See also contrib/development/MythXMLTest/ (I'm pretty sure in
> 0.21-fixes, it's just under the contrib directory) for more details on
> the XML interface. David Blain (and a few others) has put a /lot/ of
> good stuff in there that's not really being used, yet, though doing so
> would be a /very/ good thing. Much better than direct DB queries, at
> least. :)
>
Thanks, I already have some code that queries the xml interface, but
didn't realise that I could get the program data that way.

Ian.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev