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

Protocol updates in mpd v.18 #16

Closed
mikerodrigues opened this issue Mar 31, 2014 · 4 comments
Closed

Protocol updates in mpd v.18 #16

mikerodrigues opened this issue Mar 31, 2014 · 4 comments

Comments

@mikerodrigues
Copy link
Contributor

There are a few new commands and features in .18 that aren't implemented:

  • protocol:
    • new command "readcomments" lists arbitrary file tags
    • new command "toggleoutput"
    • "find"/"search" with "any" does not match file name
    • "search" and "find" with base URI (keyword "base")
    • search for album artist falls back to the artist tag
    • re-add the "volume" command

http://git.musicpd.org/cgit/master/mpd.git/plain/NEWS?h=release-0.18

:toggleoutput is pretty straightforward but :readcomments is not. :readcomments returns a hash of additional arbitrary tags on the song file. I'd like to implement it but I wanted to see if you had any comment on how it should be done.

The last 4 items already work.

@archseer
Copy link
Owner

I'd probably implement :readcomments on MPD::Song, as a Hash. So song.comments[:key] would return the comment. I guess we should also freeze it, as MPD offers no way of persisting it back to the files.

Thumbs up for contributing this and the other patch yesterday! I didn't have enough time to do it myself.

@mikerodrigues
Copy link
Contributor Author

Would you prefer to have MPD::Song instances calling #send_command or is it something that should be retrieved beforehand and then passed to MPD::Song#new?

@archseer
Copy link
Owner

I think we could do it similarly to how MPD::Playlist is done, though that does mean that MPD::Song then needs an extra parameter, passing in the MPD instance. Then when MPD::Song#comments is first called, I'd cache the thing inside the object?

I definitively wouldn't fetch it all in advance, as it would provide significant overhead when fetching large portions of the MPD database.

@mikerodrigues
Copy link
Contributor Author

#17

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