Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Jun 2008
    Posts
    101

    {QUERY} with callback interface? w/ patch (sorta)

    I was hoping to use the type='search' OPML magic, but right now it only works with an actual 'url' parameter and if you are using the callback interface you're out of luck. I did a little poking to see how hard this might be to add and I'm not quite sure what to do with the search query aside from append it to any 'passthrough' parameters. That may not be the right solution though. Here are a couple small patches that get the job done for the Web and Control version of XMLBrowser.pm The patch for the Button mode variety doesn't work and trying to figure out why makes my head hurt, but I'll attach it regardless. In the end I don't know if the way I did this is the best way or if I may have broke other things in the process, but consider it a feature request at the least

    --- Web/XMLBrowser.pm 2009-01-19 17:13:59.000000000 -0800
    +++ Web/XMLBrowser.pm 2009-05-21 18:01:17.000000000 -0700
    @@ -219,6 +219,12 @@
    if ( $subFeed->{'type'} eq 'search' && ( $stash->{'q'} || $searchQuery ) ) {
    my $search = $stash->{'q'} || $searchQuery;
    $subFeed->{'url'} =~ s/{QUERY}/$search/g;
    +
    + # Passthrough the search string as well
    + if (! $subFeed->{'passthrough'}) {
    + $subFeed->{'passthrough'} = [];
    + }
    + push @{$subFeed->{'passthrough'}}, $search;
    }

    # Setup passthrough args


    --- Control/XMLBrowser.pm 2009-01-19 17:13:59.000000000 -0800
    +++ Control/XMLBrowser.pm 2009-05-21 18:06:52.000000000 -0700
    @@ -237,6 +237,12 @@
    # Rewrite the URL if it was a search request
    if ( $subFeed->{type} eq 'search' ) {
    $subFeed->{url} =~ s/{QUERY}/$search/g;
    +
    + # Passthrough the search string as well
    + if (! $subFeed->{'passthrough'}) {
    + $subFeed->{'passthrough'} = [];
    + }
    + push @{$subFeed->{'passthrough'}}, $search;
    }

    # Setup passthrough args
    @@ -1158,4 +1164,4 @@
    }
    }

    -1;
    \ No newline at end of file
    +1;


    --- Buttons/XMLBrowser.pm 2009-01-19 17:13:59.000000000 -0800
    +++ Buttons/XMLBrowser.pm 2009-05-21 18:08:04.000000000 -0700
    @@ -785,6 +785,12 @@
    # Replace {QUERY} with search query
    $searchURL =~ s/{QUERY}/$searchString/g;

    + # Passthrough the search string as well
    + if (! $item->{'passthrough'}) {
    + $item->{'passthrough'} = [];
    + }
    + push @{$item->{'passthrough'}}, $searchString;
    +
    my %params = (
    'header' => 'SEARCHING',
    'modeName' => "XMLBrowser:$searchURL:$searchString",

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    11,249
    It's been a while since I used the "search" and {QUERY}" - but at present if you use the PARSER parameter in the OPML - the result of the query is passed straight to routine - which is effectively a callback.

    Since the user is providing the parser - the content of the search doesn't have to be just an URL

    Edit:

    A second I approach I used with current implementation was to register a pagelink and then ensure the QUERY result is page of the URL which is handled by the pagelink such as
    Code:
    <outline URL="http://localhost:9000/plugins/SharkPlay/manualtune.html?tunerfreq={QUERY}" text="Enter freq. 87.9-108.0 530-1710" type="search" />
    Last edited by bpa; 2009-05-22 at 00:14.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •