aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbUtils.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-05 23:12:33 +0200
committerMax Kellermann <max@duempel.org>2011-09-05 23:14:39 +0200
commitdadf1339b57d76057b7a66dce7d3b7b2f7d796f6 (patch)
tree6bc90138b2cac507d730c6fab8d7e07e10b8359e /src/dbUtils.c
parentc2c4228722d0f73ceeda844b09c0bb04c88a6f83 (diff)
downloadmpd-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.c19
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);