From de8af9212c4bd91bff7356d20e8aa47139d30e46 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 1 Aug 2009 20:12:04 -0700 Subject: Return song information along with path. --- libmpd/database.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libmpd/database.rb') 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_. -- cgit v1.2.3-70-g09d2