Fix moving a track down in a playlist

Yandex reads both operations of a change against the playlist as it was, so
deleting a track and inserting it at the next row's index put it back where
it was. A track moving down is now inserted after the row it passes. Moving
up was already right. The fix is in the shared client, so the TV app gets it
too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yuriy PanovandClaude Opus 5.5 committed 2026-10-23 16:27:59 +06:00
1 parent 8b7778d95c
commit a60194c5a7
3 files changed
+5 -3

No files matched your search

@@ -171,7 +171,7 @@ private fun TrackMenu(state: AppState, sheet: Sheet.TrackMenu) {
slot.up?.let { up ->
item { Item(R.drawable.ic_chevron_left, stringResource(R.string.menu_move_up)) { state.movePlaylistTrack(slot.id, track, slot.index, up) } }
}
// Delete-then-insert: the row below shifts up one, so inserting at its old index lands after it.
// The track ends up where the row below is now; the client works out Yandex's indices.
slot.down?.let { down ->
item { Item(R.drawable.ic_chevron_right, stringResource(R.string.menu_move_down)) { state.movePlaylistTrack(slot.id, track, slot.index, down) } }
}