Discussion:
[Xmltv-devel] Puzzled over --list-channels
h***@gmail.com
2013-12-10 07:44:52 UTC
Permalink
Hmm, this section of the wiki is confusing me :s

--------
Writing a listchannels_sub
The listchannels_sub shall return an xml-string listing all channels that the grabber can download data for given the current configuration.
--------

2 questions:

1) Does that mean that only those channels which will be downloaded when the grabber is *run* will be output (i.e. the grabber should not list ones which were *not* selected during configuration)?

2) It says "given the current configuration" - so does this mean I should list channels *only* for the currently selected tv platform/region (i.e. the ones they selected during --configure)? If so how do they get to see what's in the other lineups, without doing a --configure for each and every one of them?

3) This option can only be run *after* --configure has been run (since $conf is passed as the first param) - is that right? I thought the idea was so that people could see what channels *could be* available (i.e. pre configuration)?

Oops that was 3 questions :)


I suppose a more generic question encompassing the above is: what is the --list-channels option used for?

Geoff
Robert Eden
2013-12-10 17:22:49 UTC
Permalink
Post by h***@gmail.com
1) Does that mean that only those channels which will be downloaded when the grabber is *run* will be output (i.e. the grabber should not list ones which were *not* selected during configuration)?
2) It says "given the current configuration" - so does this mean I should list channels *only* for the currently selected tv platform/region (i.e. the ones they selected during --configure)? If so how do they get to see what's in the other lineups, without doing a --configure for each and every one of them?
3) This option can only be run *after* --configure has been run (since $conf is passed as the first param) - is that right? I thought the idea was so that people could see what channels *could be* available (i.e. pre configuration)?
My tv_grab_na_dd only includes channels enabled in the config file. It
does a 0 day data request (30 seconds or programs) and terminates before
displaying program info.

Not sure if that's what the configure-api folks wanted, but that's what
it does. :)

Thanks again Geoff for your new grabbers/utilities and fixes to other
things.

Robert
h***@gmail.com
2013-12-10 17:38:36 UTC
Permalink
Post by Robert Eden
My tv_grab_na_dd only includes channels enabled in the config file. It
does a 0 day data request (30 seconds or programs) and terminates before
displaying program info.
Not sure if that's what the configure-api folks wanted, but that's what
it does. :)
Ah right, that's what _za does too. I'll need to change my grabbers then since I misunderstood what this option was for.
Post by Robert Eden
Thanks again Geoff for your new grabbers/utilities and fixes to other
things.
No worries, glad to help.

Currently ploughing through _ar. Hopefully I can resurrect it tomorrow.

Geoff
Karl Dietz
2013-12-10 18:44:20 UTC
Permalink
Post by h***@gmail.com
1) Does that mean that only those channels which will be downloaded when the grabber is *run* will be output (i.e. the grabber should not list ones which were *not* selected during configuration)?
no, I'd expect to see all channels that I can choose from with the
current set of configuration options.
Post by h***@gmail.com
2) It says "given the current configuration" - so does this mean I should list channels *only* for the currently selected tv platform/region (i.e. the ones they selected during --configure)? If so how do they get to see what's in the other lineups, without doing a --configure for each and every one of them?
Yes, how they can see the full list depends on the guide source. So it
is outside of our control for at least some of the sources.
Post by h***@gmail.com
3) This option can only be run *after* --configure has been run (since $conf is passed as the first param) - is that right? I thought the idea was so that people could see what channels *could be* available (i.e. pre configuration)?
h***@gmail.com
2013-12-11 17:13:35 UTC
Permalink
Post by Karl Dietz
Post by h***@gmail.com
1) Does that mean that only those channels which will be downloaded when the grabber is *run* will be output (i.e. the grabber should not list ones which were *not* selected during configuration)?
no, I'd expect to see all channels that I can choose from with the
current set of configuration options.
Agreed.
Post by Karl Dietz
Post by h***@gmail.com
2) It says "given the current configuration" - so does this mean I should list channels *only* for the currently selected tv platform/region (i.e. the ones they selected during --configure)? If so how do they get to see what's in the other lineups, without doing a --configure for each and every one of them?
Yes, how they can see the full list depends on the guide source. So it
is outside of our control for at least some of the sources.
Yes I see. I think I'm going to have to add a "list-lineups" to my Atlas grabber.
Post by Karl Dietz
Post by h***@gmail.com
3) This option can only be run *after* --configure has been run (since $conf is passed as the first param) - is that right? I thought the idea was so that people could see what channels *could be* available (i.e. pre configuration)?
h***@gmail.com
2013-12-14 15:34:24 UTC
Permalink
Post by h***@gmail.com
Post by Karl Dietz
Post by h***@gmail.com
2) It says "given the current configuration" - so does this mean I should list channels *only* for the currently selected tv platform/region (i.e. the ones they selected during --configure)? If so how do they get to see what's in the other lineups, without doing a --configure for each and every one of them?
Yes, how they can see the full list depends on the guide source. So it
is outside of our control for at least some of the sources.
Yes I see. I think I'm going to have to add a "list-lineups" to my Atlas grabber.
Hmm. Well --list-lineups doesn't do what I thought either. Either that or the pod in options.pm is wrong.


=item list_lineups_sub

Optional. A coderef that takes a configuration
hash as returned by XMLTV::Configure::LoadConfig as the first parameter
and an option hash as returned by ParseOptions as the second parameter,
and returns an xml-string containing a list of all the channel lineups
that the grabber can deliver data for using the supplied configuration.
Note that the listsub shall not use any channel-configuration from the
hashref. The xml-string shall follow the xmltv-lineups.xsd schema.

=item get_lineup_sub

Optional. A coderef that returns an xml-string describing the configured
lineup. The xml-string shall follow the xmltv-lineups.xsd schema.



So list_lineups_sub *also* takes the config-file, which means that --configure must already have been run.

So how does a user (human or api) get a list of lineups supported by the grabber *before* running --configure?


Note: it seems that uk_rt is the only grabber which uses list_lineups_sub, and it does not reference the config hash - it simply prints a disc file:

sub list_lineups {
my $doc = parse_lineup_xml_doc( 'lineups.xml' );
return $doc->toString();
}

hence my question as whether options.pm is right or wrong?


Advice please? :)

Geoff
Robert Eden
2013-12-14 15:57:18 UTC
Permalink
Post by h***@gmail.com
So how does a user (human or api) get a list of lineups supported by the grabber *before* running --configure?
Until someone more familiar with the configure API responds... (Karl?)

The problem is some grabbers require a username/password before anything
else can be returned.
For example, with tv_grab_na_dd,
Pass1: Ask for username password.
Pass 2: Query for lineups
Pass 3: Query for stations

While interactively --configure is a single call, the configure API
allows for multiple passes..

BTW, While I wrote tv_grab_na_dd, I think it was Karl who added the
--configure-api stuff to it.

Robert

Loading...