aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue/QueueSave.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-12 19:36:39 +0200
committerMax Kellermann <max@duempel.org>2014-07-12 19:36:39 +0200
commit80d9baa9e869624264efa973ec2389825d9ce9f7 (patch)
tree4426c6939a199dfc23bc405f437e53030a41abd4 /src/queue/QueueSave.cxx
parent751995ab95298bbc0afad6958bfccce535edf53c (diff)
downloadmpd-80d9baa9e869624264efa973ec2389825d9ce9f7.tar.gz
mpd-80d9baa9e869624264efa973ec2389825d9ce9f7.tar.xz
mpd-80d9baa9e869624264efa973ec2389825d9ce9f7.zip
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).
Diffstat (limited to 'src/queue/QueueSave.cxx')
-rw-r--r--src/queue/QueueSave.cxx7
1 files changed, 6 insertions, 1 deletions
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);
}