diff options
author | Max Kellermann <max@duempel.org> | 2011-09-05 23:12:33 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-05 23:14:39 +0200 |
commit | dadf1339b57d76057b7a66dce7d3b7b2f7d796f6 (patch) | |
tree | 6bc90138b2cac507d730c6fab8d7e07e10b8359e /src/dbUtils.c | |
parent | c2c4228722d0f73ceeda844b09c0bb04c88a6f83 (diff) | |
download | mpd-dadf1339b57d76057b7a66dce7d3b7b2f7d796f6.tar.gz mpd-dadf1339b57d76057b7a66dce7d3b7b2f7d796f6.tar.xz mpd-dadf1339b57d76057b7a66dce7d3b7b2f7d796f6.zip |
dbUtils: pass player_control to findAddIn()
Allow calling findAddIn() without a client object.
Diffstat (limited to 'src/dbUtils.c')
-rw-r--r-- | src/dbUtils.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c index 9a44b314b..6ef1f6aa9 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -203,25 +203,30 @@ int addAllInToStoredPlaylist(const char *name, const char *utf8file) return db_walk(name, directoryAddSongToStoredPlaylist, NULL, &data); } +struct find_add_data { + struct player_control *pc; + const struct locate_item_list *criteria; +}; + static int findAddInDirectory(struct song *song, void *_data) { - struct search_data *data = _data; + struct find_add_data *data = _data; if (locate_song_match(song, data->criteria)) return playlist_append_song(&g_playlist, - data->client->player_control, + data->pc, song, NULL); return 0; } -int findAddIn(struct client *client, const char *name, - const struct locate_item_list *criteria) +int +findAddIn(struct player_control *pc, const char *name, + const struct locate_item_list *criteria) { - struct search_data data; - - data.client = client; + struct find_add_data data; + data.pc = pc; data.criteria = criteria; return db_walk(name, findAddInDirectory, NULL, &data); |