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
4b707829
Commit
4b707829
authored
Nov 19, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp: use the generic ::CollectUniqueTags() function
This function implements the "group" feature on top of the Database::Visit() method.
parent
841694cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
21 deletions
+4
-21
NEWS
NEWS
+2
-0
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+2
-21
No files found.
NEWS
View file @
4b707829
ver 0.21.4 (not yet released)
ver 0.21.4 (not yet released)
* database
- upnp: implement "list ... group"
ver 0.21.3 (2018/11/16)
ver 0.21.3 (2018/11/16)
* output
* output
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
4b707829
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "db/DatabasePlugin.hxx"
#include "db/DatabasePlugin.hxx"
#include "db/Selection.hxx"
#include "db/Selection.hxx"
#include "db/VHelper.hxx"
#include "db/VHelper.hxx"
#include "db/UniqueTags.hxx"
#include "db/DatabaseError.hxx"
#include "db/DatabaseError.hxx"
#include "db/LightDirectory.hxx"
#include "db/LightDirectory.hxx"
#include "song/LightSong.hxx"
#include "song/LightSong.hxx"
...
@@ -627,27 +628,7 @@ std::map<std::string, std::set<std::string>>
...
@@ -627,27 +628,7 @@ std::map<std::string, std::set<std::string>>
UpnpDatabase
::
CollectUniqueTags
(
const
DatabaseSelection
&
selection
,
UpnpDatabase
::
CollectUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag
,
TagType
group
)
const
TagType
tag
,
TagType
group
)
const
{
{
(
void
)
group
;
// TODO: use group
return
::
CollectUniqueTags
(
*
this
,
selection
,
tag
,
group
);
std
::
map
<
std
::
string
,
std
::
set
<
std
::
string
>>
result
;
auto
&
values
=
result
[
std
::
string
()];
for
(
auto
&
server
:
discovery
->
GetDirectories
())
{
const
auto
dirbuf
=
SearchSongs
(
server
,
rootid
,
selection
);
for
(
const
auto
&
dirent
:
dirbuf
.
objects
)
{
if
(
dirent
.
type
!=
UPnPDirObject
::
Type
::
ITEM
||
dirent
.
item_class
!=
UPnPDirObject
::
ItemClass
::
MUSIC
)
continue
;
const
char
*
value
=
dirent
.
tag
.
GetValue
(
tag
);
if
(
value
!=
nullptr
)
{
values
.
emplace
(
value
);
}
}
}
return
result
;
}
}
DatabaseStats
DatabaseStats
...
...
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