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
7cfe929c
Commit
7cfe929c
authored
Oct 22, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/Count: print empty group if song without grouped tag exists
Be consistent with "list" responses.
parent
6c06244e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
NEWS
NEWS
+1
-0
protocol.xml
doc/protocol.xml
+5
-0
Count.cxx
src/db/Count.cxx
+4
-4
VisitFallback.hxx
src/tag/VisitFallback.hxx
+8
-0
No files found.
NEWS
View file @
7cfe929c
ver 0.20.22 (not yet released)
* protocol
- add tag fallbacks for AlbumArtistSort, ArtistSort
- "count group ..." can print an empty group
* storage
- curl: URL-encode paths
* Android
...
...
doc/protocol.xml
View file @
7cfe929c
...
...
@@ -1599,6 +1599,11 @@ OK
per-artist counts:
</para>
<programlisting>
count group artist
</programlisting>
<para>
A group with an empty value contains counts of matching
song which don't this group tag. It exists only if at
least one such song is found.
</para>
</listitem>
</varlistentry>
...
...
src/db/Count.cxx
View file @
7cfe929c
...
...
@@ -90,10 +90,10 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
assert
(
song
.
tag
!=
nullptr
);
const
Tag
&
tag
=
*
song
.
tag
;
VisitTagWithFallback
(
tag
,
group
,
std
::
bind
(
CollectGroupCounts
,
std
::
ref
(
map
),
std
::
cref
(
tag
),
std
::
placeholders
::
_1
));
VisitTagWithFallback
OrEmpty
(
tag
,
group
,
std
::
bind
(
CollectGroupCounts
,
std
::
ref
(
map
),
std
::
cref
(
tag
),
std
::
placeholders
::
_1
));
}
void
...
...
src/tag/VisitFallback.hxx
View file @
7cfe929c
...
...
@@ -49,4 +49,12 @@ VisitTagWithFallback(const Tag &tag, TagType type, F &&f) noexcept
});
}
template
<
typename
F
>
void
VisitTagWithFallbackOrEmpty
(
const
Tag
&
tag
,
TagType
type
,
F
&&
f
)
noexcept
{
if
(
!
VisitTagWithFallback
(
tag
,
type
,
f
))
f
(
""
);
}
#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