diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-21 18:00:41 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-21 18:00:41 -0700 |
commit | 2e332839c0830cad3c853c404a9be7efa8ccc249 (patch) | |
tree | 57d2f8dc580d457c05732f94409667a5da51e491 | |
parent | ce643b5be296ec114e07152669fbd33240b57cc1 (diff) | |
download | ruby-libmpd-2e332839c0830cad3c853c404a9be7efa8ccc249.tar.gz ruby-libmpd-2e332839c0830cad3c853c404a9be7efa8ccc249.tar.xz |
Add clear and playlistinfo methods.
-rw-r--r-- | mpdlib.rb | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -97,4 +97,18 @@ class MPD def delete songpos return send_request 'delete ' + songpos.to_s end + + def clear + return send_request 'clear' + end + + # Not yet complete. + def playlistinfo + playlist = send_request 'playlistinfo' + playlist = playlist.split(/(?!\n)(?=file:)/).map do |song| + generate_hash song + end + + return playlist + end end |