playlist_edit: fix "move" relative to current when there is no current song
Fixes Mantis #3770.
This commit is contained in:
parent
dbe04c4207
commit
363050f44c
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
||||||
ver 0.17.5 (not yet released)
|
ver 0.17.5 (not yet released)
|
||||||
* protocol:
|
* protocol:
|
||||||
- fix "playlistadd" with URI
|
- fix "playlistadd" with URI
|
||||||
|
- fix "move" relative to current when there is no current song
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
- detect system "ar"
|
- detect system "ar"
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,12 @@ playlist_move_range(struct playlist *playlist, struct player_control *pc,
|
||||||
? (int)queue_order_to_position(&playlist->queue,
|
? (int)queue_order_to_position(&playlist->queue,
|
||||||
playlist->current)
|
playlist->current)
|
||||||
: -1;
|
: -1;
|
||||||
if (to < 0 && playlist->current >= 0) {
|
if (to < 0) {
|
||||||
|
if (currentSong < 0)
|
||||||
|
/* can't move relative to current song,
|
||||||
|
because there is no current song */
|
||||||
|
return PLAYLIST_RESULT_BAD_RANGE;
|
||||||
|
|
||||||
if (start <= (unsigned)currentSong && (unsigned)currentSong < end)
|
if (start <= (unsigned)currentSong && (unsigned)currentSong < end)
|
||||||
/* no-op, can't be moved to offset of itself */
|
/* no-op, can't be moved to offset of itself */
|
||||||
return PLAYLIST_RESULT_SUCCESS;
|
return PLAYLIST_RESULT_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue