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
8acf996d
Commit
8acf996d
authored
9 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/queue: add range parameter to plchanges and plchangesposid
parent
15e43220
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
58 additions
and
18 deletions
+58
-18
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+5
-1
PlaylistPrint.cxx
src/PlaylistPrint.cxx
+8
-4
PlaylistPrint.hxx
src/PlaylistPrint.hxx
+4
-2
AllCommands.cxx
src/command/AllCommands.cxx
+2
-2
QueueCommands.cxx
src/command/QueueCommands.cxx
+12
-2
QueuePrint.cxx
src/queue/QueuePrint.cxx
+22
-5
QueuePrint.hxx
src/queue/QueuePrint.hxx
+4
-2
No files found.
NEWS
View file @
8acf996d
...
@@ -5,6 +5,7 @@ ver 0.20 (not yet released)
...
@@ -5,6 +5,7 @@ ver 0.20 (not yet released)
- report song duration with milliseconds precision
- report song duration with milliseconds precision
- "sticker find" can match sticker values
- "sticker find" can match sticker values
- drop the "file:///" prefix for absolute file paths
- drop the "file:///" prefix for absolute file paths
- add range parameter to command "plchanges" and "plchangesposid"
* tags
* tags
- ape, ogg: drop support for non-standard tag "album artist"
- ape, ogg: drop support for non-standard tag "album artist"
affected filetypes: vorbis, flac, opus & all files with ape2 tags
affected filetypes: vorbis, flac, opus & all files with ape2 tags
...
...
This diff is collapsed.
Click to expand it.
doc/protocol.xml
View file @
8acf996d
...
@@ -1161,12 +1161,15 @@ OK
...
@@ -1161,12 +1161,15 @@ OK
<cmdsynopsis>
<cmdsynopsis>
<command>
plchanges
</command>
<command>
plchanges
</command>
<arg
choice=
"req"
><replaceable>
VERSION
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
VERSION
</replaceable></arg>
<arg><replaceable>
START:END
</replaceable></arg>
</cmdsynopsis>
</cmdsynopsis>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
Displays changed songs currently in the playlist since
Displays changed songs currently in the playlist since
<varname>
VERSION
</varname>
.
<varname>
VERSION
</varname>
. Start and end positions may
be given to limit the output to changes in the given
range.
</para>
</para>
<para>
<para>
To detect songs that were deleted at the end of the
To detect songs that were deleted at the end of the
...
@@ -1179,6 +1182,7 @@ OK
...
@@ -1179,6 +1182,7 @@ OK
<cmdsynopsis>
<cmdsynopsis>
<command>
plchangesposid
</command>
<command>
plchangesposid
</command>
<arg
choice=
"req"
><replaceable>
VERSION
</replaceable></arg>
<arg
choice=
"req"
><replaceable>
VERSION
</replaceable></arg>
<arg><replaceable>
START:END
</replaceable></arg>
</cmdsynopsis>
</cmdsynopsis>
</term>
</term>
<listitem>
<listitem>
...
...
This diff is collapsed.
Click to expand it.
src/PlaylistPrint.cxx
View file @
8acf996d
...
@@ -104,17 +104,21 @@ playlist_print_find(Response &r, Partition &partition,
...
@@ -104,17 +104,21 @@ playlist_print_find(Response &r, Partition &partition,
void
void
playlist_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
playlist_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
playlist
&
playlist
,
const
playlist
&
playlist
,
uint32_t
version
)
uint32_t
version
,
unsigned
start
,
unsigned
end
)
{
{
queue_print_changes_info
(
r
,
partition
,
playlist
.
queue
,
version
);
queue_print_changes_info
(
r
,
partition
,
playlist
.
queue
,
version
,
start
,
end
);
}
}
void
void
playlist_print_changes_position
(
Response
&
r
,
playlist_print_changes_position
(
Response
&
r
,
const
playlist
&
playlist
,
const
playlist
&
playlist
,
uint32_t
version
)
uint32_t
version
,
unsigned
start
,
unsigned
end
)
{
{
queue_print_changes_position
(
r
,
playlist
.
queue
,
version
);
queue_print_changes_position
(
r
,
playlist
.
queue
,
version
,
start
,
end
);
}
}
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
...
...
This diff is collapsed.
Click to expand it.
src/PlaylistPrint.hxx
View file @
8acf996d
...
@@ -79,7 +79,8 @@ playlist_print_find(Response &r, Partition &partition,
...
@@ -79,7 +79,8 @@ playlist_print_find(Response &r, Partition &partition,
void
void
playlist_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
playlist_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
playlist
&
playlist
,
const
playlist
&
playlist
,
uint32_t
version
);
uint32_t
version
,
unsigned
start
,
unsigned
end
);
/**
/**
* Print changes since the specified playlist version, position only.
* Print changes since the specified playlist version, position only.
...
@@ -87,7 +88,8 @@ playlist_print_changes_info(Response &r, Partition &partition,
...
@@ -87,7 +88,8 @@ playlist_print_changes_info(Response &r, Partition &partition,
void
void
playlist_print_changes_position
(
Response
&
r
,
playlist_print_changes_position
(
Response
&
r
,
const
playlist
&
playlist
,
const
playlist
&
playlist
,
uint32_t
version
);
uint32_t
version
,
unsigned
start
,
unsigned
end
);
/**
/**
* Send the stored playlist to the client.
* Send the stored playlist to the client.
...
...
This diff is collapsed.
Click to expand it.
src/command/AllCommands.cxx
View file @
8acf996d
...
@@ -148,8 +148,8 @@ static constexpr struct command commands[] = {
...
@@ -148,8 +148,8 @@ static constexpr struct command commands[] = {
{
"playlistinfo"
,
PERMISSION_READ
,
0
,
1
,
handle_playlistinfo
},
{
"playlistinfo"
,
PERMISSION_READ
,
0
,
1
,
handle_playlistinfo
},
{
"playlistmove"
,
PERMISSION_CONTROL
,
3
,
3
,
handle_playlistmove
},
{
"playlistmove"
,
PERMISSION_CONTROL
,
3
,
3
,
handle_playlistmove
},
{
"playlistsearch"
,
PERMISSION_READ
,
2
,
-
1
,
handle_playlistsearch
},
{
"playlistsearch"
,
PERMISSION_READ
,
2
,
-
1
,
handle_playlistsearch
},
{
"plchanges"
,
PERMISSION_READ
,
1
,
1
,
handle_plchanges
},
{
"plchanges"
,
PERMISSION_READ
,
1
,
2
,
handle_plchanges
},
{
"plchangesposid"
,
PERMISSION_READ
,
1
,
1
,
handle_plchangesposid
},
{
"plchangesposid"
,
PERMISSION_READ
,
1
,
2
,
handle_plchangesposid
},
{
"previous"
,
PERMISSION_CONTROL
,
0
,
0
,
handle_previous
},
{
"previous"
,
PERMISSION_CONTROL
,
0
,
0
,
handle_previous
},
{
"prio"
,
PERMISSION_CONTROL
,
2
,
-
1
,
handle_prio
},
{
"prio"
,
PERMISSION_CONTROL
,
2
,
-
1
,
handle_prio
},
{
"prioid"
,
PERMISSION_CONTROL
,
2
,
-
1
,
handle_prioid
},
{
"prioid"
,
PERMISSION_CONTROL
,
2
,
-
1
,
handle_prioid
},
...
...
This diff is collapsed.
Click to expand it.
src/command/QueueCommands.cxx
View file @
8acf996d
...
@@ -251,8 +251,13 @@ handle_plchanges(Client &client, Request args, Response &r)
...
@@ -251,8 +251,13 @@ handle_plchanges(Client &client, Request args, Response &r)
if
(
!
ParseCommandArg32
(
r
,
version
,
args
.
front
()))
if
(
!
ParseCommandArg32
(
r
,
version
,
args
.
front
()))
return
CommandResult
::
ERROR
;
return
CommandResult
::
ERROR
;
RangeArg
range
=
RangeArg
::
All
();
if
(
!
args
.
ParseOptional
(
1
,
range
,
r
))
return
CommandResult
::
ERROR
;
playlist_print_changes_info
(
r
,
client
.
partition
,
playlist_print_changes_info
(
r
,
client
.
partition
,
client
.
playlist
,
version
);
client
.
playlist
,
version
,
range
.
start
,
range
.
end
);
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
}
}
...
@@ -263,7 +268,12 @@ handle_plchangesposid(Client &client, Request args, Response &r)
...
@@ -263,7 +268,12 @@ handle_plchangesposid(Client &client, Request args, Response &r)
if
(
!
ParseCommandArg32
(
r
,
version
,
args
.
front
()))
if
(
!
ParseCommandArg32
(
r
,
version
,
args
.
front
()))
return
CommandResult
::
ERROR
;
return
CommandResult
::
ERROR
;
playlist_print_changes_position
(
r
,
client
.
playlist
,
version
);
RangeArg
range
=
RangeArg
::
All
();
if
(
!
args
.
ParseOptional
(
1
,
range
,
r
))
return
CommandResult
::
ERROR
;
playlist_print_changes_position
(
r
,
client
.
playlist
,
version
,
range
.
start
,
range
.
end
);
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/queue/QueuePrint.cxx
View file @
8acf996d
...
@@ -71,19 +71,36 @@ queue_print_uris(Response &r, Partition &partition, const Queue &queue,
...
@@ -71,19 +71,36 @@ queue_print_uris(Response &r, Partition &partition, const Queue &queue,
void
void
queue_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
Queue
&
queue
,
queue_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
Queue
&
queue
,
uint32_t
version
)
uint32_t
version
,
unsigned
start
,
unsigned
end
)
{
{
for
(
unsigned
i
=
0
;
i
<
queue
.
GetLength
();
i
++
)
{
assert
(
start
<=
end
);
if
(
start
>=
queue
.
GetLength
())
return
;
if
(
end
>
queue
.
GetLength
())
end
=
queue
.
GetLength
();
for
(
unsigned
i
=
start
;
i
<
end
;
i
++
)
if
(
queue
.
IsNewerAtPosition
(
i
,
version
))
if
(
queue
.
IsNewerAtPosition
(
i
,
version
))
queue_print_song_info
(
r
,
partition
,
queue
,
i
);
queue_print_song_info
(
r
,
partition
,
queue
,
i
);
}
}
}
void
void
queue_print_changes_position
(
Response
&
r
,
const
Queue
&
queue
,
queue_print_changes_position
(
Response
&
r
,
const
Queue
&
queue
,
uint32_t
version
)
uint32_t
version
,
unsigned
start
,
unsigned
end
)
{
{
for
(
unsigned
i
=
0
;
i
<
queue
.
GetLength
();
i
++
)
assert
(
start
<=
end
);
if
(
start
>=
queue
.
GetLength
())
return
;
if
(
end
>
queue
.
GetLength
())
end
=
queue
.
GetLength
();
for
(
unsigned
i
=
start
;
i
<
end
;
i
++
)
if
(
queue
.
IsNewerAtPosition
(
i
,
version
))
if
(
queue
.
IsNewerAtPosition
(
i
,
version
))
r
.
Format
(
"cpos: %i
\n
Id: %i
\n
"
,
r
.
Format
(
"cpos: %i
\n
Id: %i
\n
"
,
i
,
queue
.
PositionToId
(
i
));
i
,
queue
.
PositionToId
(
i
));
...
...
This diff is collapsed.
Click to expand it.
src/queue/QueuePrint.hxx
View file @
8acf996d
...
@@ -42,11 +42,13 @@ queue_print_uris(Response &r, Partition &partition, const Queue &queue,
...
@@ -42,11 +42,13 @@ queue_print_uris(Response &r, Partition &partition, const Queue &queue,
void
void
queue_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
Queue
&
queue
,
queue_print_changes_info
(
Response
&
r
,
Partition
&
partition
,
const
Queue
&
queue
,
uint32_t
version
);
uint32_t
version
,
unsigned
start
,
unsigned
end
);
void
void
queue_print_changes_position
(
Response
&
r
,
const
Queue
&
queue
,
queue_print_changes_position
(
Response
&
r
,
const
Queue
&
queue
,
uint32_t
version
);
uint32_t
version
,
unsigned
start
,
unsigned
end
);
void
void
queue_find
(
Response
&
response
,
Partition
&
partition
,
const
Queue
&
queue
,
queue_find
(
Response
&
response
,
Partition
&
partition
,
const
Queue
&
queue
,
...
...
This diff is collapsed.
Click to expand it.
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