summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmpd/database.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmpd/database.rb b/libmpd/database.rb
index 3f5616e..20099c8 100644
--- a/libmpd/database.rb
+++ b/libmpd/database.rb
@@ -5,8 +5,13 @@
# See http://www.gnu.org/licenses/gpl.txt for the full license text.
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]
+ end
+
# Finds all songs in the database where _field_ is _value_.
- # Matching is case-sensitive.
#
# Possible field names: album, artist, title.
def find field, value