Code

Implement a search-format configuration option (Mantis #4007)
[ncmpc.git] / src / mpdclient.c
index 9baf70bc7134fa8d2125f4ff463660052eb3ff82..1e01486a27c8c65bffcfaead13f95a08612a7eaa 100644 (file)
 
 #define BUFSIZE 1024
 
-/* sort by list-format */
+/* sort by song format */
 gint
 compare_filelistentry_format(gconstpointer filelist_entry1,
-                            gconstpointer filelist_entry2)
+                            gconstpointer filelist_entry2,
+                            const char *song_format)
 {
        const struct mpd_entity *e1 =
                ((const struct filelist_entry *)filelist_entry1)->entity;
@@ -50,8 +51,8 @@ compare_filelistentry_format(gconstpointer filelist_entry1,
            mpd_entity_get_type(e1) == MPD_ENTITY_TYPE_SONG &&
            mpd_entity_get_type(e2) == MPD_ENTITY_TYPE_SONG) {
                char key1[BUFSIZE], key2[BUFSIZE];
-               strfsong(key1, BUFSIZE, options.list_format, mpd_entity_get_song(e1));
-               strfsong(key2, BUFSIZE, options.list_format, mpd_entity_get_song(e2));
+               strfsong(key1, BUFSIZE, song_format, mpd_entity_get_song(e1));
+               strfsong(key2, BUFSIZE, song_format, mpd_entity_get_song(e2));
                n = strcmp(key1,key2);
        }