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
993f8d6a
Commit
993f8d6a
authored
Sep 02, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/Print: pass RangeArg to db_selection_print()
parent
68f824a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+1
-1
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+11
-10
DatabasePrint.hxx
src/db/DatabasePrint.hxx
+2
-1
No files found.
src/command/DatabaseCommands.cxx
View file @
993f8d6a
...
...
@@ -113,7 +113,7 @@ handle_match(Client &client, Request args, Response &r, bool fold_case)
db_selection_print
(
r
,
client
.
GetPartition
(),
selection
,
true
,
false
,
sort
,
descending
,
window
.
start
,
window
.
end
);
window
);
return
CommandResult
::
OK
;
}
...
...
src/db/DatabasePrint.cxx
View file @
993f8d6a
...
...
@@ -24,6 +24,7 @@
#include "TimePrint.hxx"
#include "TagPrint.hxx"
#include "client/Response.hxx"
#include "protocol/RangeArg.hxx"
#include "Partition.hxx"
#include "song/DetachedSong.hxx"
#include "song/Filter.hxx"
...
...
@@ -180,7 +181,7 @@ db_selection_print(Response &r, Partition &partition,
const
DatabaseSelection
&
selection
,
bool
full
,
bool
base
,
TagType
sort
,
bool
descending
,
unsigned
window_start
,
unsigned
window_end
)
RangeArg
window
)
{
const
Database
&
db
=
partition
.
GetDatabaseOrThrow
();
...
...
@@ -199,10 +200,10 @@ db_selection_print(Response &r, Partition &partition,
:
VisitPlaylist
();
if
(
sort
==
TAG_NUM_OF_ITEM_TYPES
)
{
if
(
window
_
start
>
0
||
window
_
end
<
(
unsigned
)
std
::
numeric_limits
<
int
>::
max
())
s
=
[
s
,
window
_start
,
window_end
,
&
i
](
const
LightSong
&
song
){
const
bool
in_window
=
i
>=
window
_start
&&
i
<
window_
end
;
if
(
window
.
start
>
0
||
window
.
end
<
(
unsigned
)
std
::
numeric_limits
<
int
>::
max
())
s
=
[
s
,
window
,
&
i
](
const
LightSong
&
song
){
const
bool
in_window
=
i
>=
window
.
start
&&
i
<
window
.
end
;
++
i
;
if
(
in_window
)
s
(
song
);
...
...
@@ -242,15 +243,15 @@ db_selection_print(Response &r, Partition &partition,
b
.
GetTag
());
});
if
(
window
_
end
<
songs
.
size
())
songs
.
erase
(
std
::
next
(
songs
.
begin
(),
window
_
end
),
if
(
window
.
end
<
songs
.
size
())
songs
.
erase
(
std
::
next
(
songs
.
begin
(),
window
.
end
),
songs
.
end
());
if
(
window
_
start
>=
songs
.
size
())
if
(
window
.
start
>=
songs
.
size
())
return
;
songs
.
erase
(
songs
.
begin
(),
std
::
next
(
songs
.
begin
(),
window
_
start
));
std
::
next
(
songs
.
begin
(),
window
.
start
));
for
(
const
auto
&
song
:
songs
)
s
((
LightSong
)
song
);
...
...
@@ -264,7 +265,7 @@ db_selection_print(Response &r, Partition &partition,
{
db_selection_print
(
r
,
partition
,
selection
,
full
,
base
,
TAG_NUM_OF_ITEM_TYPES
,
false
,
0
,
std
::
numeric_limits
<
int
>::
max
());
RangeArg
::
All
());
}
static
void
...
...
src/db/DatabasePrint.hxx
View file @
993f8d6a
...
...
@@ -26,6 +26,7 @@ enum TagType : uint8_t;
class
TagMask
;
class
SongFilter
;
struct
DatabaseSelection
;
struct
RangeArg
;
struct
Partition
;
class
Response
;
...
...
@@ -47,7 +48,7 @@ db_selection_print(Response &r, Partition &partition,
const
DatabaseSelection
&
selection
,
bool
full
,
bool
base
,
TagType
sort
,
bool
descending
,
unsigned
window_start
,
unsigned
window_end
);
RangeArg
window
);
void
PrintSongUris
(
Response
&
r
,
Partition
&
partition
,
...
...
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