aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-19 19:01:34 +0100
committerMax Kellermann <max@duempel.org>2009-01-19 19:01:34 +0100
commit2934585d5ae3d7b74e4bec099711d6e75271cc35 (patch)
tree7fb6c5d146cccb11e55db2e185ce75075d764c2a /src/update.c
parent638f95aa15e068e3568f03ea2349a70dcd471221 (diff)
downloadmpd-2934585d5ae3d7b74e4bec099711d6e75271cc35.tar.gz
mpd-2934585d5ae3d7b74e4bec099711d6e75271cc35.tar.xz
mpd-2934585d5ae3d7b74e4bec099711d6e75271cc35.zip
update: delete stickers of deleted songs
When a song is deleted from the database, remove its sticker, too. What's still missing is some sort of garbage collector after a fresh database create (--create-db).
Diffstat (limited to '')
-rw-r--r--src/update.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/update.c b/src/update.c
index 1edb8cc01..4316dd727 100644
--- a/src/update.c
+++ b/src/update.c
@@ -36,6 +36,10 @@
#include "main.h"
#include "config.h"
+#ifdef ENABLE_SQLITE
+#include "song_sticker.h"
+#endif
+
#include <glib.h>
#include <assert.h>
@@ -717,6 +721,11 @@ static void song_delete_event(void)
g_debug("removing: %s", uri);
g_free(uri);
+#ifdef ENABLE_SQLITE
+ /* if the song has a sticker, delete it */
+ sticker_song_delete(delete);
+#endif
+
deleteASongFromPlaylist(delete);
delete = NULL;