break;
}
}
+void save_disc(void)
+{
+ char buf[6];
+ sprintf(buf, "disc%d", disc);
+
+ mpd_sendCommandListBegin(mpd);
+ mpd_sendRmCommand(mpd, buf);
+ mpd_sendSaveCommand(mpd, buf);
+ mpd_sendCommandListEnd(mpd);
+ mpd_finishCommand(mpd);
+
+ syslog(LOG_NOTICE, "Saved changes to playlist %s\n", buf);
+}
int mainloop(void)
{
continue;
}
+ if (sts->playlist != plid) {
+ save_disc();
+ track = -1;
+ }
+
if (sts->state == MPD_STATUS_STATE_PLAY) {
if (sts->song != track ||
sts->playlist != plid) {
mpd_freeInfoEntity(e);
}
- for (i = 0; i < CAR2PC_MAX_DISC; i++) {
+ for (i = 0; i <= CAR2PC_MAX_DISC; i++) {
struct file_list *tmp = pl_files;
int matched = 1;
char buf[6];