Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
c60d374f
Commit
c60d374f
authored
Mar 25, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/DatabasePlaylist: pass DatabaseSelection to search_add_to_playlist()
parent
de4fd4c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+2
-1
PlaylistCommands.cxx
src/command/PlaylistCommands.cxx
+3
-1
DatabasePlaylist.cxx
src/db/DatabasePlaylist.cxx
+2
-4
DatabasePlaylist.hxx
src/db/DatabasePlaylist.hxx
+4
-4
No files found.
src/command/DatabaseCommands.cxx
View file @
c60d374f
...
...
@@ -188,9 +188,10 @@ handle_searchaddpl(Client &client, Request args, Response &r)
filter
.
Optimize
();
const
Database
&
db
=
client
.
GetDatabaseOrThrow
();
const
DatabaseSelection
selection
(
""
,
true
,
&
filter
);
search_add_to_playlist
(
db
,
client
.
GetStorage
(),
""
,
playlist
,
&
filter
);
playlist
,
selection
);
return
CommandResult
::
OK
;
}
...
...
src/command/PlaylistCommands.cxx
View file @
c60d374f
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "PlaylistCommands.hxx"
#include "Request.hxx"
#include "db/Selection.hxx"
#include "db/DatabasePlaylist.hxx"
#include "CommandError.hxx"
#include "PlaylistSave.hxx"
...
...
@@ -180,9 +181,10 @@ handle_playlistadd(Client &client, Request args, gcc_unused Response &r)
}
else
{
#ifdef ENABLE_DATABASE
const
Database
&
db
=
client
.
GetDatabaseOrThrow
();
const
DatabaseSelection
selection
(
uri
,
true
,
nullptr
);
search_add_to_playlist
(
db
,
client
.
GetStorage
(),
uri
,
playlist
,
nullptr
);
playlist
,
selection
);
#else
r
.
Error
(
ACK_ERROR_NO_EXIST
,
"directory or file not found"
);
return
CommandResult
::
ERROR
;
...
...
src/db/DatabasePlaylist.cxx
View file @
c60d374f
...
...
@@ -36,11 +36,9 @@ AddSong(const Storage *storage, const char *playlist_path_utf8,
void
search_add_to_playlist
(
const
Database
&
db
,
const
Storage
*
storage
,
const
char
*
uri
,
const
char
*
playlist_path_utf8
,
const
SongFilter
*
filter
)
const
char
*
playlist_path_utf8
,
const
DatabaseSelection
&
selection
)
{
const
DatabaseSelection
selection
(
uri
,
true
,
filter
);
using
namespace
std
::
placeholders
;
const
auto
f
=
std
::
bind
(
AddSong
,
storage
,
playlist_path_utf8
,
_1
);
...
...
src/db/DatabasePlaylist.hxx
View file @
c60d374f
...
...
@@ -24,12 +24,12 @@
class
Database
;
class
Storage
;
class
SongFilter
;
struct
DatabaseSelection
;
gcc_nonnull
(
3
,
4
)
gcc_nonnull
(
3
)
void
search_add_to_playlist
(
const
Database
&
db
,
const
Storage
*
storage
,
const
char
*
uri
,
const
char
*
path_utf8
,
const
SongFilter
*
filter
);
const
char
*
playlist_
path_utf8
,
const
DatabaseSelection
&
selection
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment