catblob: Fix "no matches" message.
[paraslash.git] / mm.c
diff --git a/mm.c b/mm.c
index 4f76d40..af99a36 100644 (file)
--- a/mm.c
+++ b/mm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2011 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -32,7 +32,7 @@
 enum mood_comparator_id {MOOD_COMPARATORS NUM_MOOD_COMPARATORS};
 #undef MC
 #define MC(a, b) # b,
-const char const *mood_comparators[] = {MOOD_COMPARATORS};
+static const char *mood_comparators[] = {MOOD_COMPARATORS};
 #undef MC
 
 static int parse_mood_comparator(const char *word)
@@ -187,6 +187,14 @@ static int mm_channels_score_function(__a_unused const char *path,
        return mm_compare_num_score_function(afhi->channels, private);
 }
 
+static int mm_num_played_score_function(__a_unused const char *path,
+               const struct afs_info *afsi,
+               __a_unused const struct afh_info *afhi,
+               const void *private)
+{
+       return mm_compare_num_score_function(afsi->num_played, private);
+}
+
 struct mm_year_data {
        /** Comparator and year given at the mood line. */
        struct mm_compare_num_data *cnd;
@@ -343,5 +351,6 @@ const struct mood_method mood_methods[] = {
        {DEFINE_COMPARE_NUM_MOOD_METHOD(bitrate)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(frequency)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(channels)},
+       {DEFINE_COMPARE_NUM_MOOD_METHOD(num_played)},
        {.parser = NULL}
 };