db/DatabasePlaylist: increment only one variable
Fixes "searchaddpl" bug emitting bogus error "Bad position". Closes https://github.com/MusicPlayerDaemon/MPD/issues/1338
This commit is contained in:
parent
77df5a8f24
commit
dcb5ca203c
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
|||
ver 0.23.5 (not yet released)
|
||||
* protocol
|
||||
- fix "searchaddpl" bug (bogus error "Bad position")
|
||||
* migrate to PCRE2
|
||||
* GCC 12 build fixes
|
||||
|
||||
|
|
|
@ -53,10 +53,9 @@ SearchInsertIntoPlaylist(const Database &db, const Storage *storage,
|
|||
|
||||
unsigned n = 0;
|
||||
|
||||
db.Visit(selection, [&playlist, &position, &n, storage](const auto &song){
|
||||
db.Visit(selection, [&playlist, position, &n, storage](const auto &song){
|
||||
playlist.Insert(position + n,
|
||||
DatabaseDetachSong(storage, song));
|
||||
++position;
|
||||
++n;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue