1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-11-22 08:14:48 +00:00

Merge pull request #4 from BenjaminHae/sortable

Make playlist sortable
This commit is contained in:
Daniel Schregenberger
2015-10-16 14:24:54 +02:00
5 changed files with 45 additions and 1 deletions

View File

@@ -85,6 +85,14 @@ int callback_mpd(struct mg_connection *c)
if(sscanf(c->content, "MPD_API_RM_TRACK,%u", &uint_buf))
mpd_run_delete_id(mpd.conn, uint_buf);
break;
case MPD_API_MOVE_TRACK:
if (sscanf(c->content, "MPD_API_MOVE_TRACK,%u,%u", &uint_buf, &uint_buf_2) == 2)
{
uint_buf -= 1;
uint_buf_2 -= 1;
mpd_run_move(mpd.conn, uint_buf, uint_buf_2);
}
break;
case MPD_API_PLAY_TRACK:
if(sscanf(c->content, "MPD_API_PLAY_TRACK,%u", &uint_buf))
mpd_run_play_id(mpd.conn, uint_buf);

View File

@@ -47,6 +47,7 @@
X(MPD_API_SAVE_QUEUE) \
X(MPD_API_RM_TRACK) \
X(MPD_API_RM_ALL) \
X(MPD_API_MOVE_TRACK) \
X(MPD_API_SEARCH) \
X(MPD_API_SET_VOLUME) \
X(MPD_API_SET_PAUSE) \