aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/update/Remove.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-04 19:16:30 +0100
committerMax Kellermann <max@duempel.org>2014-02-04 19:53:37 +0100
commitff665b37cb92e2a1664bbab207030a1eedfbb036 (patch)
tree1325b9260c35080b5140eed90a65211276aa946c /src/db/update/Remove.cxx
parentce738430147427b3bb44063a96cedbae4c53a03d (diff)
downloadmpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.tar.gz
mpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.tar.xz
mpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.zip
db/DatabaseListener: add method OnDatabaseSongRemoved()
Decouples db/update/Remove.cpp from global variables.
Diffstat (limited to '')
-rw-r--r--src/db/update/Remove.cxx22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/db/update/Remove.cxx b/src/db/update/Remove.cxx
index e2c172a4b..102347905 100644
--- a/src/db/update/Remove.cxx
+++ b/src/db/update/Remove.cxx
@@ -20,20 +20,11 @@
#include "config.h" /* must be first for large file support */
#include "Remove.hxx"
#include "UpdateDomain.hxx"
-#include "GlobalEvents.hxx"
-#include "thread/Mutex.hxx"
-#include "thread/Cond.hxx"
#include "db/Song.hxx"
#include "db/LightSong.hxx"
-#include "Main.hxx"
-#include "Instance.hxx"
+#include "db/DatabaseListener.hxx"
#include "Log.hxx"
-#ifdef ENABLE_SQLITE
-#include "sticker/StickerDatabase.hxx"
-#include "sticker/SongSticker.hxx"
-#endif
-
#include <assert.h>
/**
@@ -50,16 +41,7 @@ UpdateRemoveService::RunDeferred()
FormatDefault(update_domain, "removing %s", uri.c_str());
}
-#ifdef ENABLE_SQLITE
- /* if the song has a sticker, remove it */
- if (sticker_enabled())
- sticker_song_delete(removed_song->Export());
-#endif
-
- {
- const auto uri = removed_song->GetURI();
- instance->DeleteSong(uri.c_str());
- }
+ listener.OnDatabaseSongRemoved(removed_song->Export());
/* clear "removed_song" and send signal to update thread */
remove_mutex.lock();