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
4682ae08
Commit
4682ae08
authored
Nov 23, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/database: support relative offsets for "searchadd"
Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1337
parent
fd5b1958
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
NEWS
NEWS
+1
-0
protocol.rst
doc/protocol.rst
+3
-0
meson.build
meson.build
+1
-1
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+17
-1
No files found.
NEWS
View file @
4682ae08
ver 0.23.5 (not yet released)
* protocol
- support relative offsets for "searchadd"
- fix "searchaddpl" bug (bogus error "Bad position")
* migrate to PCRE2
* GCC 12 build fixes
...
...
doc/protocol.rst
View file @
4682ae08
...
...
@@ -1222,6 +1222,8 @@ The music database
The ``position`` parameter specifies where the songs will be
inserted. [#since_0_23]_
It can be relative to the current song as in :ref:`addid
<command_addid>`. [#since_0_23_5]_
.. _command_searchaddpl:
...
...
@@ -1659,3 +1661,4 @@ client-to-client messages are local to the current partition.
.. [#since_0_23_1] Since :program:`MPD` 0.23.1
.. [#since_0_23_3] Since :program:`MPD` 0.23.3
.. [#since_0_23_4] Since :program:`MPD` 0.23.4
.. [#since_0_23_5] Since :program:`MPD` 0.23.5
meson.build
View file @
4682ae08
...
...
@@ -44,7 +44,7 @@ version_conf = configuration_data()
version_conf.set_quoted('PACKAGE', meson.project_name())
version_conf.set_quoted('PACKAGE_NAME', meson.project_name())
version_conf.set_quoted('VERSION', meson.project_version())
version_conf.set_quoted('PROTOCOL_VERSION', '0.23.
4
')
version_conf.set_quoted('PROTOCOL_VERSION', '0.23.
5
')
configure_file(output: 'Version.h', configuration: version_conf)
conf = configuration_data()
...
...
src/command/DatabaseCommands.cxx
View file @
4682ae08
...
...
@@ -18,6 +18,7 @@
*/
#include "DatabaseCommands.hxx"
#include "PositionArg.hxx"
#include "Request.hxx"
#include "Partition.hxx"
#include "db/DatabaseQueue.hxx"
...
...
@@ -86,6 +87,20 @@ ParseQueuePosition(Request &args, unsigned queue_length)
return
queue_length
;
}
static
unsigned
ParseInsertPosition
(
Request
&
args
,
const
playlist
&
playlist
)
{
if
(
args
.
size
>=
2
&&
StringIsEqual
(
args
[
args
.
size
-
2
],
"position"
))
{
unsigned
position
=
ParseInsertPosition
(
args
.
back
(),
playlist
);
args
.
pop_back
();
args
.
pop_back
();
return
position
;
}
/* append to the end of the queue by default */
return
playlist
.
queue
.
GetLength
();
}
/**
* Convert all remaining arguments to a #DatabaseSelection.
*
...
...
@@ -160,7 +175,8 @@ handle_match_add(Client &client, Request args, bool fold_case)
{
auto
&
partition
=
client
.
GetPartition
();
const
auto
queue_length
=
partition
.
playlist
.
queue
.
GetLength
();
const
unsigned
position
=
ParseQueuePosition
(
args
,
queue_length
);
const
unsigned
position
=
ParseInsertPosition
(
args
,
partition
.
playlist
);
SongFilter
filter
;
const
auto
selection
=
ParseDatabaseSelection
(
args
,
fold_case
,
filter
);
...
...
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