lib/mpd_client.rb in mpd_client-0.0.4 vs lib/mpd_client.rb in mpd_client-0.0.5
- old
+ new
@@ -7,11 +7,11 @@
ERROR_PREFIX = "ACK "
SUCCESS = "OK"
NEXT = "list_OK"
# MPD changelog: http://git.musicpd.org/cgit/master/mpd.git/plain/NEWS
-# http://mpd.wikia.com/wiki/MusicPlayerDaemonCommands
+# http://www.musicpd.org/doc/protocol/command_reference.html
# http://git.musicpd.org/cgit/cirrus/mpd.git/plain/doc/protocol.xml
#
COMMANDS = {
# Status Commands
"clearerror" => "fetch_nothing",
@@ -43,10 +43,12 @@
"seekcur" => "fetch_nothing",
"stop" => "fetch_nothing",
# Playlist Commands
"add" => "fetch_nothing",
"addid" => "fetch_item",
+ "addtagid" => "fetch_nothing",
+ "cleartagid" => "fetch_nothing",
"clear" => "fetch_nothing",
"delete" => "fetch_nothing",
"deleteid" => "fetch_nothing",
"move" => "fetch_nothing",
"moveid" => "fetch_nothing",
@@ -57,10 +59,11 @@
"playlistsearch" => "fetch_songs",
"plchanges" => "fetch_songs",
"plchangesposid" => "fetch_changes",
"prio" => "fetch_nothing",
"prioid" => "fetch_nothing",
+ "rangeid" => "fetch_nothing",
"shuffle" => "fetch_nothing",
"swap" => "fetch_nothing",
"swapid" => "fetch_nothing",
# Stored Playlist Commands
"listplaylist" => "fetch_list",
@@ -79,17 +82,23 @@
"find" => "fetch_songs",
"findadd" => "fetch_nothing",
"list" => "fetch_list",
"listall" => "fetch_database",
"listallinfo" => "fetch_database",
+ "listfiles" => "fetch_database",
"lsinfo" => "fetch_database",
"search" => "fetch_songs",
"searchadd" => "fetch_nothing",
"searchaddp1" => "fetch_nothing",
"update" => "fetch_item",
"rescan" => "fetch_item",
"readcomments" => "fetch_item",
+ # Mounts and neighbors
+ "mount" => "fetch_nothing",
+ "unmount" => "fetch_nothing",
+ "listmounts" => "fetch_mounts",
+ "listneighbors" => "fetch_neighbors",
# Sticker Commands
"sticker get" => "fetch_sticker",
"sticker set" => "fetch_nothing",
"sticker delete" => "fetch_nothing",
"sticker list" => "fetch_stickers",
@@ -163,11 +172,11 @@
@port = port
reconnect
end
def reconnect
- log.info("MPD (re)connect #{host}, #{port}") if log
+ log.info("MPD (re)connect #{@host}, #{@port}") if log
if @host.start_with?('/')
@socket = UNIXSocket.new(@host)
hello
else
@socket = TCPSocket.new(@host, @port)
@@ -336,9 +345,13 @@
end
def fetch_changes; fetch_objects(['cpos']); end
def fetch_songs; fetch_objects(['file']); end
+
+ def fetch_mounts; fetch_objects(['mount']); end
+
+ def fetch_neighbors; fetch_objects(['neighbor']); end
def fetch_messages; fetch_objects('channel'); end
def fetch_outputs; fetch_objects(['outputid']); end