diff options
Diffstat (limited to '')
-rw-r--r-- | src/command/DatabaseCommands.cxx | 7 | ||||
-rw-r--r-- | src/command/PlaylistCommands.cxx | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index 2b871e565..b458b3756 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "DatabaseCommands.hxx" +#include "db/DatabaseGlue.hxx" #include "db/DatabaseQueue.hxx" #include "db/DatabasePlaylist.hxx" #include "db/DatabasePrint.hxx" @@ -119,7 +120,11 @@ handle_searchaddpl(Client &client, int argc, char *argv[]) } Error error; - return search_add_to_playlist("", playlist, &filter, error) + const Database *db = GetDatabase(error); + if (db == nullptr) + return print_error(client, error); + + return search_add_to_playlist(*db, "", playlist, &filter, error) ? CommandResult::OK : print_error(client, error); } diff --git a/src/command/PlaylistCommands.cxx b/src/command/PlaylistCommands.cxx index 10dfff876..07cc177d6 100644 --- a/src/command/PlaylistCommands.cxx +++ b/src/command/PlaylistCommands.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "PlaylistCommands.hxx" +#include "db/DatabaseGlue.hxx" #include "db/DatabasePlaylist.hxx" #include "CommandError.hxx" #include "PlaylistPrint.hxx" @@ -192,7 +193,11 @@ handle_playlistadd(Client &client, gcc_unused int argc, char *argv[]) success = spl_append_uri(playlist, loader, uri, error); } else { #ifdef ENABLE_DATABASE - success = search_add_to_playlist(uri, playlist, nullptr, + const Database *db = GetDatabase(error); + if (db == nullptr) + return print_error(client, error); + + success = search_add_to_playlist(*db, uri, playlist, nullptr, error); #else success = false; |