diff options
Diffstat (limited to '')
-rw-r--r-- | src/DatabasePlaylist.cxx | 9 | ||||
-rw-r--r-- | src/DatabaseQueue.cxx | 7 | ||||
-rw-r--r-- | src/PlaylistCommands.cxx | 5 | ||||
-rw-r--r-- | src/QueueCommands.cxx | 4 | ||||
-rw-r--r-- | src/dbUtils.h | 40 |
5 files changed, 5 insertions, 60 deletions
diff --git a/src/DatabasePlaylist.cxx b/src/DatabasePlaylist.cxx index 69d87dfd7..1faf79dad 100644 --- a/src/DatabasePlaylist.cxx +++ b/src/DatabasePlaylist.cxx @@ -22,7 +22,6 @@ #include "DatabaseSelection.hxx" extern "C" { -#include "dbUtils.h" #include "stored_playlist.h" } @@ -53,11 +52,3 @@ search_add_to_playlist(const char *uri, const char *playlist_path_utf8, const auto f = std::bind(AddSong, playlist_path_utf8, _1, _2); return db->Visit(selection, f, error_r); } - -bool -addAllInToStoredPlaylist(const char *uri_utf8, const char *playlist_path_utf8, - GError **error_r) -{ - return search_add_to_playlist(uri_utf8, playlist_path_utf8, nullptr, - error_r); -} diff --git a/src/DatabaseQueue.cxx b/src/DatabaseQueue.cxx index 0e6e57848..527539401 100644 --- a/src/DatabaseQueue.cxx +++ b/src/DatabaseQueue.cxx @@ -22,7 +22,6 @@ #include "DatabaseSelection.hxx" extern "C" { -#include "dbUtils.h" #include "playlist.h" } @@ -59,9 +58,3 @@ findAddIn(struct player_control *pc, const char *uri, const auto f = std::bind(AddToQueue, pc, _1, _2); return db->Visit(selection, f, error_r); } - -bool -addAllIn(struct player_control *pc, const char *uri, GError **error_r) -{ - return findAddIn(pc, uri, nullptr, error_r); -} diff --git a/src/PlaylistCommands.cxx b/src/PlaylistCommands.cxx index aa2e8654a..d74036ec3 100644 --- a/src/PlaylistCommands.cxx +++ b/src/PlaylistCommands.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "PlaylistCommands.hxx" +#include "DatabasePlaylist.hxx" #include "CommandError.h" extern "C" { @@ -32,7 +33,6 @@ extern "C" { #include "ls.h" #include "uri.h" #include "stored_playlist.h" -#include "dbUtils.h" #include "client_internal.h" } @@ -201,7 +201,8 @@ handle_playlistadd(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) success = spl_append_uri(argv[1], playlist, &error); } else - success = addAllInToStoredPlaylist(uri, playlist, &error); + success = search_add_to_playlist(uri, playlist, nullptr, + &error); if (!success && error == NULL) { command_error(client, ACK_ERROR_NO_EXIST, diff --git a/src/QueueCommands.cxx b/src/QueueCommands.cxx index 8083cc96f..de00cb18d 100644 --- a/src/QueueCommands.cxx +++ b/src/QueueCommands.cxx @@ -20,6 +20,7 @@ #include "config.h" #include "QueueCommands.hxx" #include "CommandError.h" +#include "DatabaseQueue.hxx" extern "C" { #include "protocol/argparser.h" @@ -29,7 +30,6 @@ extern "C" { #include "ls.h" #include "uri.h" #include "locate.h" -#include "dbUtils.h" #include "client_internal.h" #include "client_file.h" } @@ -70,7 +70,7 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) } GError *error = NULL; - return addAllIn(client->player_control, uri, &error) + return findAddIn(client->player_control, uri, nullptr, &error) ? COMMAND_RETURN_OK : print_error(client, error); } diff --git a/src/dbUtils.h b/src/dbUtils.h deleted file mode 100644 index b26422ef8..000000000 --- a/src/dbUtils.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2003-2011 The Music Player Daemon Project - * http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPD_DB_UTILS_H -#define MPD_DB_UTILS_H - -#include "gcc.h" -#include "gerror.h" - -#include <stdbool.h> - -struct locate_item_list; -struct player_control; - -gcc_nonnull(1,2) -bool -addAllIn(struct player_control *pc, const char *uri, GError **error_r); - -gcc_nonnull(1,2) -bool -addAllInToStoredPlaylist(const char *uri_utf8, const char *path_utf8, - GError **error_r); - -#endif |