Commit 1c5e69b721ea3cbbf37cf2d610670273e7cce303

Anton Maminov 2015-03-18T14:49:12

added rangeid example

diff --git a/MPD_COMMANDS.md b/MPD_COMMANDS.md
index c52fb30..7cfe0b1 100644
--- a/MPD_COMMANDS.md
+++ b/MPD_COMMANDS.md
@@ -419,7 +419,7 @@ Some of the commands described in this section can be used to run playlist plugi
 > Same as `listall`, except it also returns metadata info in the same format as `lsinfo`.
 
 ---
-`listfiles [URI]`
+`listfiles [URI] => fetch_database`
 
 > Lists the contents of the directory `URI`, including files are not recognized by `MPD`. `URI` can be a path relative to the music directory or an `URI` understood by one of the storage plugins. The response contains at least one line for each directory entry with the prefix `"file: "` or  `"directory: "`, and may be followed by file attributes such as `"Last-Modified"` and `"size"`.
 
diff --git a/examples/rangeid.rb b/examples/rangeid.rb
new file mode 100644
index 0000000..350dfdc
--- /dev/null
+++ b/examples/rangeid.rb
@@ -0,0 +1,24 @@
+require 'bundler'
+Bundler.setup :default
+
+require 'pp'
+require 'logger'
+require 'mpd_client'
+
+MPDClient.log = Logger.new($stderr)
+
+client = MPDClient.new
+client.connect('localhost', 6600)
+
+# Get id of the first song in the playllist
+song = client.playlistinfo(1).first
+pp "#{song['artist']} - #{song['title']}"
+song_id = song['id']
+
+# Specifies the portion of the song that shall be played
+client.rangeid(song_id, [60,70])
+
+# Play the playlist at song 1
+client.play(1)
+
+pp client.status