command/playlist: move code to SearchInsertIntoPlaylist()
This commit is contained in:
@@ -231,15 +231,12 @@ handle_playlistadd_position(Client &client, const char *playlist_name,
|
||||
editor.Insert(position, uri);
|
||||
} else {
|
||||
#ifdef ENABLE_DATABASE
|
||||
const auto &db = client.GetDatabaseOrThrow();
|
||||
const auto *storage = client.GetStorage();
|
||||
const DatabaseSelection selection(uri, true, nullptr);
|
||||
|
||||
db.Visit(selection, [&editor, &position, storage](const auto &song){
|
||||
editor.Insert(position,
|
||||
DatabaseDetachSong(storage, song));
|
||||
++position;
|
||||
});
|
||||
SearchInsertIntoPlaylist(client.GetDatabaseOrThrow(),
|
||||
client.GetStorage(),
|
||||
selection,
|
||||
editor, position);
|
||||
#else
|
||||
(void)client;
|
||||
r.Error(ACK_ERROR_NO_EXIST, "No database");
|
||||
|
Reference in New Issue
Block a user