Skip to content

Calling find with a search window (startend) fails #180

@joshaw

Description

@joshaw

I'm trying to work out the syntax for using a search window when using find(). The MPD documentation says:

find {FILTER} [sort {TYPE}] [window {START:END}]
...
window can be used to query only a portion of the real response. The parameter is two zero-based record numbers; a start number and an end number.

And the python-mpd2 documentation says

MPDClient.find(type, what[, ..., startend])
...
window can be used to query only a portion of the real response. The parameter is two zero-based record numbers; a start number and an end number.

But I can't find a syntax that doesn't give an error.

  • Using a single string in the form from the MPD docs like client.find("any", query, "1:100") gives

    mpd.base.CommandError: [2@0] {search} Incorrect number of filter arguments
    

    I also tried using space instead of : and using window 1:100 in case the window string is necessary.

  • Doing the same but adding in the sort parameter (client.find("any", query, "title", "1:100")) gives no search results - I guess it's now trying to find tracks with a title of 1:100.

  • Using two separate parameters like client.find("any", query, "1", "100") gives

    mpd.base.CommandError: [2@0] {search} Unknown filter type
    

My query is working fine without the window, I'd just like to enable pagination so I don't get thousands of results returned for short queries. I couldn't find any examples in the examples directory and none of the tests use this feature either. Any help would be greatly appreciated. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions