(Menu) Implement playlist_delete_index

This commit is contained in:
Jean-André Santoni 2016-08-29 01:38:46 +02:00
parent f387e627f3
commit a5fc3b01ba
1 changed files with 4 additions and 3 deletions

View File

@ -103,11 +103,12 @@ void playlist_delete_index(playlist_t *playlist,
if (!playlist) if (!playlist)
return; return;
const char *label = NULL; memmove(playlist->entries + idx, playlist->entries + idx + 1,
(playlist->size - idx) * sizeof(struct playlist_entry));
playlist_get_index(playlist, idx, NULL, &label, NULL, NULL, NULL, NULL); playlist->size = playlist->size - 1;
printf("%s %zu\n", label, idx); playlist_write_file(playlist);
} }
void playlist_get_index_by_path(playlist_t *playlist, void playlist_get_index_by_path(playlist_t *playlist,