diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-08-01 13:10:30 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-08-01 13:10:30 -0700 |
commit | a5b89802ef7614b214e92a1e6b03ebc17e3557b5 (patch) | |
tree | 3666470265f4481810d5f6474dde6d5ffe032ae0 /libmpd/database.rb | |
parent | 86d08df03202ac183c1f38b47765f2a4cfcafd72 (diff) | |
download | ruby-libmpd-a5b89802ef7614b214e92a1e6b03ebc17e3557b5.tar.gz ruby-libmpd-a5b89802ef7614b214e92a1e6b03ebc17e3557b5.tar.xz |
Various cleanup.
Diffstat (limited to 'libmpd/database.rb')
-rw-r--r-- | libmpd/database.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libmpd/database.rb b/libmpd/database.rb index c71c517..00cc693 100644 --- a/libmpd/database.rb +++ b/libmpd/database.rb @@ -13,31 +13,31 @@ module MPDDatabase # Counts the number of songs in the database where _field_ is _value_, as # well as their total playtime. - def count field, value - return generate_hash send_request 'count %s "%s"' % [field, value] + def count(field, value) + return generate_hash(send_request('count %s "%s"' % [field, value])) end # Finds all songs in the database where _field_ is _value_. # # Possible field names: album, artist, title. - def find field, value - return split_and_hash send_request 'find %s "%s"' % [field, value] + def find(field, value) + return split_and_hash(send_request('find %s "%s"' % [field, value])) end # Finds all songs in the database where _field_ contains _value_. # Matching is not case-sensitive. # # Possible field names: album, artist, filename, title. - def search field, value - return split_and_hash send_request 'search %s "%s"' % [field, value] + def search(field, value) + return split_and_hash(send_request('search %s "%s"' % [field, value])) end # Updates the database. # If an argument is given, update that particular file or directory. - def update uri=nil + def update(uri=nil) command = 'update' command << ' "%s"' % uri if uri - return send_request command + return send_request(command) end end |