diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-08-01 20:12:04 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-08-01 20:12:04 -0700 |
commit | de8af9212c4bd91bff7356d20e8aa47139d30e46 (patch) | |
tree | 688efd47c211f82e66698abb45c8bf09c0bfe785 /libmpd | |
parent | 2a7a1fa600a9e99ccd7c80bfac0446313e51e01a (diff) | |
download | ruby-libmpd-de8af9212c4bd91bff7356d20e8aa47139d30e46.tar.gz ruby-libmpd-de8af9212c4bd91bff7356d20e8aa47139d30e46.tar.xz |
Return song information along with path.
Diffstat (limited to 'libmpd')
-rw-r--r-- | libmpd/database.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpd/database.rb b/libmpd/database.rb index c88527c..e5f86b3 100644 --- a/libmpd/database.rb +++ b/libmpd/database.rb @@ -51,7 +51,10 @@ module MPDDatabase path = String.new end - return send_request(command).scan(/^file: (#{path}.+?)\n/).flatten + files = send_request(command) + files = files.gsub(/^directory: .+?\n/, '').sub(/^playlist: .+/m, '') + + return split_and_hash(files) end # Finds all songs in the database where _field_ contains _value_. |