diff options
author | Kalle Wallin <kaw@linux.se> | 2005-06-14 22:04:50 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2005-06-14 22:04:50 +0000 |
commit | 7c9aa09019ac6ab2cdf847d785c2dc127a46ac94 (patch) | |
tree | 985b894e7bf3dbd80da78be3203a47d954ff240e /src/mpdclient.c | |
parent | 1304e410279ad52fe295ad61c9af78a82d56cc88 (diff) | |
download | mpd-7c9aa09019ac6ab2cdf847d785c2dc127a46ac94.tar.gz mpd-7c9aa09019ac6ab2cdf847d785c2dc127a46ac94.tar.xz mpd-7c9aa09019ac6ab2cdf847d785c2dc127a46ac94.zip |
Added exact_match parameter to mpdclient_filelist_search()
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3357 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/mpdclient.c')
-rw-r--r-- | src/mpdclient.c | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/src/mpdclient.c b/src/mpdclient.c index 03c69f30e..1cb06bc75 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -885,13 +885,19 @@ mpdclient_filelist_get(mpdclient_t *c, gchar *path) } mpdclient_filelist_t * -mpdclient_filelist_search_utf8(mpdclient_t *c, int table, gchar *filter_utf8) +mpdclient_filelist_search_utf8(mpdclient_t *c, + int exact_match, + int table, + gchar *filter_utf8) { mpdclient_filelist_t *filelist; mpd_InfoEntity *entity; D("mpdclient_filelist_search(%s)\n", filter_utf8); - mpd_sendSearchCommand(c->connection, table, filter_utf8); + if( exact_match ) + mpd_sendFindCommand(c->connection, table, filter_utf8); + else + mpd_sendSearchCommand(c->connection, table, filter_utf8); filelist = g_malloc0(sizeof(mpdclient_filelist_t)); while( (entity=mpd_getNextInfoEntity(c->connection)) ) @@ -913,13 +919,16 @@ mpdclient_filelist_search_utf8(mpdclient_t *c, int table, gchar *filter_utf8) mpdclient_filelist_t * -mpdclient_filelist_search(mpdclient_t *c, int table, gchar *filter) +mpdclient_filelist_search(mpdclient_t *c, + int exact_match, + int table, + gchar *filter) { mpdclient_filelist_t *filelist; gchar *filter_utf8 = locale_to_utf8(filter); D("mpdclient_filelist_search(%s)\n", filter); - filelist = mpdclient_filelist_search_utf8(c, table, filter_utf8); + filelist = mpdclient_filelist_search_utf8(c,exact_match,table,filter_utf8); g_free(filter_utf8); return filelist; @@ -964,6 +973,38 @@ mpdclient_filelist_find_song(mpdclient_filelist_t *fl, mpd_Song *song) return NULL; } +int +mpdclient_filelist_add_all(mpdclient_t *c, mpdclient_filelist_t *fl) +{ + GList *list = g_list_first(fl->list); + + if( fl->list==NULL || fl->length<1 ) + return 0; + + mpd_sendCommandListBegin(c->connection); + while( list ) + { + filelist_entry_t *entry = list->data; + mpd_InfoEntity *entity = entry->entity; + + if( entity && entity->type==MPD_INFO_ENTITY_TYPE_SONG ) + { + mpd_Song *song = entity->info.song; + + mpd_sendAddCommand(c->connection, song->file); + } + list = list->next; + } + mpd_sendCommandListEnd(c->connection); + return mpdclient_finish_command(c); +} + + + + + + + GList * mpdclient_get_artists_utf8(mpdclient_t *c) |