Commit 2934585d authored by Max Kellermann's avatar Max Kellermann

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).
parent 638f95aa
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
#include "main.h" #include "main.h"
#include "config.h" #include "config.h"
#ifdef ENABLE_SQLITE
#include "song_sticker.h"
#endif
#include <glib.h> #include <glib.h>
#include <assert.h> #include <assert.h>
...@@ -717,6 +721,11 @@ static void song_delete_event(void) ...@@ -717,6 +721,11 @@ static void song_delete_event(void)
g_debug("removing: %s", uri); g_debug("removing: %s", uri);
g_free(uri); g_free(uri);
#ifdef ENABLE_SQLITE
/* if the song has a sticker, delete it */
sticker_song_delete(delete);
#endif
deleteASongFromPlaylist(delete); deleteASongFromPlaylist(delete);
delete = NULL; delete = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment