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
a577944a
Commit
a577944a
authored
Oct 26, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: new commands "findin", "searchin" with base URI
parent
17ec3b0c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
4 deletions
+60
-4
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+34
-0
AllCommands.cxx
src/command/AllCommands.cxx
+2
-0
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+17
-4
DatabaseCommands.hxx
src/command/DatabaseCommands.hxx
+6
-0
No files found.
NEWS
View file @
a577944a
...
@@ -5,6 +5,7 @@ ver 0.18 (2012/??/??)
...
@@ -5,6 +5,7 @@ ver 0.18 (2012/??/??)
* protocol:
* protocol:
- new command "readcomments" lists arbitrary file tags
- new command "readcomments" lists arbitrary file tags
- new command "toggleoutput"
- new command "toggleoutput"
- new commands "findin", "searchin" with base URI
- search for album artist falls back to the artist tag
- search for album artist falls back to the artist tag
- re-add the "volume" command
- re-add the "volume" command
* input:
* input:
...
...
doc/protocol.xml
View file @
a577944a
...
@@ -1491,6 +1491,23 @@ OK
...
@@ -1491,6 +1491,23 @@ OK
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry
id=
"command_findin"
>
<term>
<cmdsynopsis>
<command>
findin
</command>
<arg
choice=
"req"
><replaceable>
URI
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
TYPE
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
WHAT
</replaceable></arg>
<arg
choice=
"opt"
><replaceable>
...
</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Like
<command>
find
</command>
, but allows specifying a
base URI for the find.
</para>
</listitem>
</varlistentry>
<varlistentry
id=
"command_findadd"
>
<varlistentry
id=
"command_findadd"
>
<term>
<term>
<cmdsynopsis>
<cmdsynopsis>
...
@@ -1626,6 +1643,23 @@ OK
...
@@ -1626,6 +1643,23 @@ OK
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry
id=
"command_searchin"
>
<term>
<cmdsynopsis>
<command>
searchin
</command>
<arg
choice=
"req"
><replaceable>
URI
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
TYPE
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
WHAT
</replaceable></arg>
<arg
choice=
"opt"
><replaceable>
...
</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Like
<command>
search
</command>
, but allows specifying a
base URI for the search.
</para>
</listitem>
</varlistentry>
<varlistentry
id=
"command_searchadd"
>
<varlistentry
id=
"command_searchadd"
>
<term>
<term>
<cmdsynopsis>
<cmdsynopsis>
...
...
src/command/AllCommands.cxx
View file @
a577944a
...
@@ -91,6 +91,7 @@ static const struct command commands[] = {
...
@@ -91,6 +91,7 @@ static const struct command commands[] = {
{
"enableoutput"
,
PERMISSION_ADMIN
,
1
,
1
,
handle_enableoutput
},
{
"enableoutput"
,
PERMISSION_ADMIN
,
1
,
1
,
handle_enableoutput
},
{
"find"
,
PERMISSION_READ
,
2
,
-
1
,
handle_find
},
{
"find"
,
PERMISSION_READ
,
2
,
-
1
,
handle_find
},
{
"findadd"
,
PERMISSION_READ
,
2
,
-
1
,
handle_findadd
},
{
"findadd"
,
PERMISSION_READ
,
2
,
-
1
,
handle_findadd
},
{
"findin"
,
PERMISSION_READ
,
3
,
-
1
,
handle_find_in
},
{
"idle"
,
PERMISSION_READ
,
0
,
-
1
,
handle_idle
},
{
"idle"
,
PERMISSION_READ
,
0
,
-
1
,
handle_idle
},
{
"kill"
,
PERMISSION_ADMIN
,
-
1
,
-
1
,
handle_kill
},
{
"kill"
,
PERMISSION_ADMIN
,
-
1
,
-
1
,
handle_kill
},
{
"list"
,
PERMISSION_READ
,
1
,
-
1
,
handle_list
},
{
"list"
,
PERMISSION_READ
,
1
,
-
1
,
handle_list
},
...
@@ -142,6 +143,7 @@ static const struct command commands[] = {
...
@@ -142,6 +143,7 @@ static const struct command commands[] = {
{
"search"
,
PERMISSION_READ
,
2
,
-
1
,
handle_search
},
{
"search"
,
PERMISSION_READ
,
2
,
-
1
,
handle_search
},
{
"searchadd"
,
PERMISSION_ADD
,
2
,
-
1
,
handle_searchadd
},
{
"searchadd"
,
PERMISSION_ADD
,
2
,
-
1
,
handle_searchadd
},
{
"searchaddpl"
,
PERMISSION_CONTROL
,
3
,
-
1
,
handle_searchaddpl
},
{
"searchaddpl"
,
PERMISSION_CONTROL
,
3
,
-
1
,
handle_searchaddpl
},
{
"searchin"
,
PERMISSION_READ
,
3
,
-
1
,
handle_search_in
},
{
"seek"
,
PERMISSION_CONTROL
,
2
,
2
,
handle_seek
},
{
"seek"
,
PERMISSION_CONTROL
,
2
,
2
,
handle_seek
},
{
"seekcur"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_seekcur
},
{
"seekcur"
,
PERMISSION_CONTROL
,
1
,
1
,
handle_seekcur
},
{
"seekid"
,
PERMISSION_CONTROL
,
2
,
2
,
handle_seekid
},
{
"seekid"
,
PERMISSION_CONTROL
,
2
,
2
,
handle_seekid
},
...
...
src/command/DatabaseCommands.cxx
View file @
a577944a
...
@@ -55,7 +55,8 @@ handle_lsinfo2(Client &client, int argc, char *argv[])
...
@@ -55,7 +55,8 @@ handle_lsinfo2(Client &client, int argc, char *argv[])
}
}
static
CommandResult
static
CommandResult
handle_match
(
Client
&
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
handle_match
(
Client
&
client
,
int
argc
,
char
*
argv
[],
const
char
*
uri
,
bool
fold_case
)
{
{
SongFilter
filter
;
SongFilter
filter
;
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
...
@@ -63,7 +64,7 @@ handle_match(Client &client, int argc, char *argv[], bool fold_case)
...
@@ -63,7 +64,7 @@ handle_match(Client &client, int argc, char *argv[], bool fold_case)
return
CommandResult
::
ERROR
;
return
CommandResult
::
ERROR
;
}
}
const
DatabaseSelection
selection
(
""
,
true
,
&
filter
);
const
DatabaseSelection
selection
(
uri
,
true
,
&
filter
);
Error
error
;
Error
error
;
return
db_selection_print
(
client
,
selection
,
true
,
error
)
return
db_selection_print
(
client
,
selection
,
true
,
error
)
...
@@ -74,13 +75,25 @@ handle_match(Client &client, int argc, char *argv[], bool fold_case)
...
@@ -74,13 +75,25 @@ handle_match(Client &client, int argc, char *argv[], bool fold_case)
CommandResult
CommandResult
handle_find
(
Client
&
client
,
int
argc
,
char
*
argv
[])
handle_find
(
Client
&
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match
(
client
,
argc
,
argv
,
false
);
return
handle_match
(
client
,
argc
,
argv
,
""
,
false
);
}
CommandResult
handle_find_in
(
Client
&
client
,
int
argc
,
char
*
argv
[])
{
return
handle_match
(
client
,
argc
-
1
,
argv
+
1
,
argv
[
1
],
false
);
}
}
CommandResult
CommandResult
handle_search
(
Client
&
client
,
int
argc
,
char
*
argv
[])
handle_search
(
Client
&
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match
(
client
,
argc
,
argv
,
true
);
return
handle_match
(
client
,
argc
,
argv
,
""
,
true
);
}
CommandResult
handle_search_in
(
Client
&
client
,
int
argc
,
char
*
argv
[])
{
return
handle_match
(
client
,
argc
-
1
,
argv
+
1
,
argv
[
1
],
true
);
}
}
static
CommandResult
static
CommandResult
...
...
src/command/DatabaseCommands.hxx
View file @
a577944a
...
@@ -31,12 +31,18 @@ CommandResult
...
@@ -31,12 +31,18 @@ CommandResult
handle_find
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
handle_find
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
CommandResult
handle_find_in
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
handle_findadd
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
handle_findadd
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
CommandResult
handle_search
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
handle_search
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
CommandResult
handle_search_in
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
handle_searchadd
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
handle_searchadd
(
Client
&
client
,
int
argc
,
char
*
argv
[]);
CommandResult
CommandResult
...
...
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