From 80d9baa9e869624264efa973ec2389825d9ce9f7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Jul 2014 19:36:39 +0200 Subject: [PATCH] QueueSave: use the long format to save partial songs Previously, only streams were saved with range and tags, but this is necessary for all "partial" songs (e.g. CUE tracks). --- NEWS | 1 + src/queue/QueueSave.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ab5139a5b..dacc68f53 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ ver 0.19 (not yet released) - smbclient: new plugin * playlist - cue: fix bogus duration of the last track + - cue: restore CUE tracks from state file - soundcloud: use https instead of http - soundcloud: add default API key * archive diff --git a/src/queue/QueueSave.cxx b/src/queue/QueueSave.cxx index 28fc361d7..5f47a0fac 100644 --- a/src/queue/QueueSave.cxx +++ b/src/queue/QueueSave.cxx @@ -50,9 +50,14 @@ queue_save_full_song(FILE *fp, const DetachedSong &song) static void queue_save_song(FILE *fp, int idx, const DetachedSong &song) { - if (song.IsInDatabase()) + if (song.IsInDatabase() && + song.GetStartMS() == 0 && song.GetEndMS() == 0) + /* use the brief format (just the URI) for "full" + database songs */ queue_save_database_song(fp, idx, song); else + /* use the long format (URI, range, tags) for the + rest, so all metadata survives a MPD restart */ queue_save_full_song(fp, song); }