Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit search results #50

Open
Phrogz opened this issue Jan 7, 2016 · 2 comments
Open

Limit search results #50

Phrogz opened this issue Jan 7, 2016 · 2 comments

Comments

@Phrogz
Copy link
Contributor

Phrogz commented Jan 7, 2016

I have a DB that's currently at 17k songs (and growing). Some search terms can produce a lot of results, like:

@mpd.where file:'.'
@mpd.where any:'e'

Calls like this take 1.3 seconds on the server before they return. In my interface I then go on to truncate the results to the first 500. I'd like to be able to:

@mpd.where {file:'.'}, {limit:500}

and have the results limited for me.

I realize that this requires MPD support. I've posted a feature request on the MPD forum.

(FWIW, I also tried modifying build_songs_list in parser.rb to accept an optional limit, to reduce the number of songs created in the map. Reducing the map set from 16883 songs to 500 songs only reduced the time from 1.27s to 1.23s, a negligible savings.)

@Phrogz
Copy link
Contributor Author

Phrogz commented Jan 9, 2016

Apparently this is possible already in MPD:

You can use the "window" argument to limit the search. That's a 0.20~git feature.

@archseer
Copy link
Owner

The library is currently a bit behind, we're currently supporting all features up to 0.18 (#16), I think. We'd have to go and pull out any protocol changes listed for 0.19 and 0.20 http://git.musicpd.org/cgit/master/mpd.git/plain/NEWS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants