summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Instance.cxx8
-rw-r--r--src/Instance.hxx2
-rw-r--r--src/db/DatabaseListener.hxx2
-rw-r--r--src/db/update/Remove.cxx3
-rw-r--r--test/DumpDatabase.cxx4
5 files changed, 8 insertions, 11 deletions
diff --git a/src/Instance.cxx b/src/Instance.cxx
index 3559ca528..cfe19fbb8 100644
--- a/src/Instance.cxx
+++ b/src/Instance.cxx
@@ -26,7 +26,6 @@
#ifdef ENABLE_DATABASE
#include "db/DatabaseError.hxx"
-#include "db/LightSong.hxx"
#ifdef ENABLE_SQLITE
#include "sticker/StickerDatabase.hxx"
@@ -57,18 +56,17 @@ Instance::OnDatabaseModified()
}
void
-Instance::OnDatabaseSongRemoved(const LightSong &song)
+Instance::OnDatabaseSongRemoved(const char *uri)
{
assert(database != nullptr);
#ifdef ENABLE_SQLITE
/* if the song has a sticker, remove it */
if (sticker_enabled())
- sticker_song_delete(song, IgnoreError());
+ sticker_song_delete(uri, IgnoreError());
#endif
- const auto uri = song.GetURI();
- partition->DeleteSong(uri.c_str());
+ partition->DeleteSong(uri);
}
#endif
diff --git a/src/Instance.hxx b/src/Instance.hxx
index 2b413d699..4cd8ced9f 100644
--- a/src/Instance.hxx
+++ b/src/Instance.hxx
@@ -115,7 +115,7 @@ struct Instance final
private:
#ifdef ENABLE_DATABASE
void OnDatabaseModified() override;
- void OnDatabaseSongRemoved(const LightSong &song) override;
+ void OnDatabaseSongRemoved(const char *uri) override;
#endif
#ifdef ENABLE_NEIGHBOR_PLUGINS
diff --git a/src/db/DatabaseListener.hxx b/src/db/DatabaseListener.hxx
index df85d9c64..6cc54469d 100644
--- a/src/db/DatabaseListener.hxx
+++ b/src/db/DatabaseListener.hxx
@@ -40,7 +40,7 @@ public:
* During database update, a song is about to be removed from
* the database because the file has disappeared.
*/
- virtual void OnDatabaseSongRemoved(const LightSong &song) = 0;
+ virtual void OnDatabaseSongRemoved(const char *uri) = 0;
};
#endif
diff --git a/src/db/update/Remove.cxx b/src/db/update/Remove.cxx
index aed7e787f..6f4f54ca1 100644
--- a/src/db/update/Remove.cxx
+++ b/src/db/update/Remove.cxx
@@ -39,10 +39,9 @@ UpdateRemoveService::RunDeferred()
{
const auto uri = removed_song->GetURI();
FormatDefault(update_domain, "removing %s", uri.c_str());
+ listener.OnDatabaseSongRemoved(uri.c_str());
}
- listener.OnDatabaseSongRemoved(removed_song->Export());
-
/* clear "removed_song" and send signal to update thread */
remove_mutex.lock();
removed_song = nullptr;
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 1b9bdae6a..a6673f581 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -57,8 +57,8 @@ public:
cout << "DatabaseModified" << endl;
}
- virtual void OnDatabaseSongRemoved(const LightSong &song) override {
- cout << "SongRemoved " << song.GetURI() << endl;
+ virtual void OnDatabaseSongRemoved(const char *uri) override {
+ cout << "SongRemoved " << uri << endl;
}
};