-
Notifications
You must be signed in to change notification settings - Fork 120
Description
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}]
...
windowcan 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")givesmpd.base.CommandError: [2@0] {search} Incorrect number of filter argumentsI also tried using space instead of
:and usingwindow 1:100in case thewindowstring is necessary. -
Doing the same but adding in the
sortparameter (client.find("any", query, "title", "1:100")) gives no search results - I guess it's now trying to find tracks with a title of1:100. -
Using two separate parameters like
client.find("any", query, "1", "100")givesmpd.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.