summaryrefslogtreecommitdiff
path: root/src/command/StickerCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-29 17:45:07 +0100
committerMax Kellermann <max@duempel.org>2014-01-29 17:45:07 +0100
commitff87145537f1d71388be8759688235a75fccf373 (patch)
tree252ef8a5faec7ead1ee2c817815a67571022a5da /src/command/StickerCommands.cxx
parent667481c3719bfb1639d330154f82b58b16f26343 (diff)
sticker: don't use classes Directory and Song
Don't depend on the "simple" database plugin. This fixes an assertion failure / crash and allows using stickers with other plugins.
Diffstat (limited to 'src/command/StickerCommands.cxx')
-rw-r--r--src/command/StickerCommands.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/command/StickerCommands.cxx b/src/command/StickerCommands.cxx
index 68a0d585f..5234e2da8 100644
--- a/src/command/StickerCommands.cxx
+++ b/src/command/StickerCommands.cxx
@@ -124,24 +124,17 @@ handle_sticker_song(Client &client, int argc, char *argv[])
/* find song dir key */
} else if (argc == 5 && strcmp(argv[1], "find") == 0) {
/* "sticker find song a/directory name" */
+
+ const char *const base_uri = argv[3];
+
bool success;
struct sticker_song_find_data data = {
client,
argv[4],
};
- db_lock();
- Directory *directory = db_get_directory(argv[3]);
- if (directory == nullptr) {
- db_unlock();
- command_error(client, ACK_ERROR_NO_EXIST,
- "no such directory");
- return CommandResult::ERROR;
- }
-
- success = sticker_song_find(*directory, data.name,
+ success = sticker_song_find(base_uri, data.name,
sticker_song_find_print_cb, &data);
- db_unlock();
if (!success) {
command_error(client, ACK_ERROR_SYSTEM,
"failed to set search sticker database");