jotak / mipod

A node module for exposing an MPD API, either as REST service, Websocket or as a library to include. Written in Typescript, executed in Javascript.
MIT License
17 stars 4 forks source link

Add the count command #12

Open Delapouite opened 9 years ago

Delapouite commented 9 years ago

Hello

I managed to get the info I needed throught the custom command, but it would be easier if the count method described at the top of the page was available directly on the API. http://www.musicpd.org/doc/protocol/database.html

Thanks.

jotak commented 9 years ago

Good idea, I'll add it

jotak commented 9 years ago

I'm trying out some code for that. It's not clear to me how "count" works, because I can't test it : don't know if it works with the sqlite DB which is not activated on my installation, or if my MPD version is too old (it's not the latest). The "count group artist" command printed as example in doc gives "invalid arguments" to me. "count artist song" gives 0 result.

So if you want, I can implement it "blindly" and you tell me if it's ok

Delapouite commented 9 years ago

No worries, I'll have a go on this one.

I use the count command to display an histogram of number of songs per year. It's a good way to discover if you're more a nostalgic guy still living in the 80's or if your music collection is more modern.

On a side note I've already created multiple issues on your great project. But don't be affraid, I don't want to put the all the burden over your shoulders. I just write them down as a reminder of the "missing" parts I've identified and my intentention is to try to provide pull request for them soon.

jotak commented 9 years ago

That's fair. Having issues to solve makes the project living, it's a good thing!