Add support for readcomments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4afe86..6cf0a11 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# MPDClient CHANGELOG
+### 0.0.4
+
+* Add support for readcomments
+
### 0.0.3
* Support for logging
diff --git a/MPD_COMMANDS.md b/MPD_COMMANDS.md
index ebdf0ce..012a3b0 100644
--- a/MPD_COMMANDS.md
+++ b/MPD_COMMANDS.md
@@ -431,6 +431,15 @@ Some of the commands described in this section can be used to run playlist plugi
> Same as `update`, but also rescans unmodified files.
+---
+`readcomments [URI] => fetch_object`
+
+> Read "comments" (i.e. key-value pairs) from the file specified by `URI`. This `URI` can be a path relative to the music directory or a URL in the form `file:///foo/bar.ogg`.
+
+> The response consists of lines in the form "KEY: VALUE". Comments with suspicious characters (e.g. newlines) are ignored silently.
+
+> The meaning of these depends on the codec, and not all decoder plugins support it. For example, on Ogg files, this lists the Vorbis comments.
+
### Sticker Commands
"Stickers" are pieces of information attached to existing MPD objects (e.g. song files, directories, albums). Clients can create arbitrary name/value pairs. MPD itself does not assume any special meaning in them.
diff --git a/lib/mpd_client.rb b/lib/mpd_client.rb
index 854524e..41acfef 100644
--- a/lib/mpd_client.rb
+++ b/lib/mpd_client.rb
@@ -86,6 +86,7 @@ COMMANDS = {
"searchaddp1" => "fetch_nothing",
"update" => "fetch_item",
"rescan" => "fetch_item",
+ "readcomments" => "fetch_item",
# Sticker Commands
"sticker get" => "fetch_sticker",
"sticker set" => "fetch_nothing",