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
f71c204e
Commit
f71c204e
authored
Jan 28, 2017
by
Thomas Zander
Committed by
Max Kellermann
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct method types to match Interface.hxx
parent
51147203
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
36 deletions
+13
-36
Count.cxx
src/db/Count.cxx
+2
-6
DatabasePlaylist.cxx
src/db/DatabasePlaylist.cxx
+1
-2
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+8
-23
DatabaseQueue.cxx
src/db/DatabaseQueue.cxx
+1
-2
Helpers.cxx
src/db/Helpers.cxx
+1
-3
No files found.
src/db/Count.cxx
View file @
f71c204e
...
@@ -62,7 +62,7 @@ Print(Response &r, TagType group, const TagCountMap &m)
...
@@ -62,7 +62,7 @@ Print(Response &r, TagType group, const TagCountMap &m)
}
}
}
}
static
bool
static
void
stats_visitor_song
(
SearchStats
&
stats
,
const
LightSong
&
song
)
stats_visitor_song
(
SearchStats
&
stats
,
const
LightSong
&
song
)
{
{
stats
.
n_songs
++
;
stats
.
n_songs
++
;
...
@@ -70,8 +70,6 @@ stats_visitor_song(SearchStats &stats, const LightSong &song)
...
@@ -70,8 +70,6 @@ stats_visitor_song(SearchStats &stats, const LightSong &song)
const
auto
duration
=
song
.
GetDuration
();
const
auto
duration
=
song
.
GetDuration
();
if
(
!
duration
.
IsNegative
())
if
(
!
duration
.
IsNegative
())
stats
.
total_duration
+=
duration
;
stats
.
total_duration
+=
duration
;
return
true
;
}
}
static
bool
static
bool
...
@@ -94,7 +92,7 @@ CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag)
...
@@ -94,7 +92,7 @@ CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag)
return
found
;
return
found
;
}
}
static
bool
static
void
GroupCountVisitor
(
TagCountMap
&
map
,
TagType
group
,
const
LightSong
&
song
)
GroupCountVisitor
(
TagCountMap
&
map
,
TagType
group
,
const
LightSong
&
song
)
{
{
assert
(
song
.
tag
!=
nullptr
);
assert
(
song
.
tag
!=
nullptr
);
...
@@ -103,8 +101,6 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
...
@@ -103,8 +101,6 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
if
(
!
CollectGroupCounts
(
map
,
group
,
tag
)
&&
group
==
TAG_ALBUM_ARTIST
)
if
(
!
CollectGroupCounts
(
map
,
group
,
tag
)
&&
group
==
TAG_ALBUM_ARTIST
)
/* fall back to "Artist" if no "AlbumArtist" was found */
/* fall back to "Artist" if no "AlbumArtist" was found */
CollectGroupCounts
(
map
,
TAG_ARTIST
,
tag
);
CollectGroupCounts
(
map
,
TAG_ARTIST
,
tag
);
return
true
;
}
}
void
void
...
...
src/db/DatabasePlaylist.cxx
View file @
f71c204e
...
@@ -27,13 +27,12 @@
...
@@ -27,13 +27,12 @@
#include <functional>
#include <functional>
static
bool
static
void
AddSong
(
const
Storage
&
storage
,
const
char
*
playlist_path_utf8
,
AddSong
(
const
Storage
&
storage
,
const
char
*
playlist_path_utf8
,
const
LightSong
&
song
)
const
LightSong
&
song
)
{
{
spl_append_song
(
playlist_path_utf8
,
spl_append_song
(
playlist_path_utf8
,
DatabaseDetachSong
(
storage
,
song
));
DatabaseDetachSong
(
storage
,
song
));
return
true
;
}
}
void
void
...
...
src/db/DatabasePrint.cxx
View file @
f71c204e
...
@@ -49,16 +49,14 @@ PrintDirectoryURI(Response &r, bool base, const LightDirectory &directory)
...
@@ -49,16 +49,14 @@ PrintDirectoryURI(Response &r, bool base, const LightDirectory &directory)
ApplyBaseFlag
(
directory
.
GetPath
(),
base
));
ApplyBaseFlag
(
directory
.
GetPath
(),
base
));
}
}
static
bool
static
void
PrintDirectoryBrief
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
PrintDirectoryBrief
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
{
{
if
(
!
directory
.
IsRoot
())
if
(
!
directory
.
IsRoot
())
PrintDirectoryURI
(
r
,
base
,
directory
);
PrintDirectoryURI
(
r
,
base
,
directory
);
return
true
;
}
}
static
bool
static
void
PrintDirectoryFull
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
PrintDirectoryFull
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
{
{
if
(
!
directory
.
IsRoot
())
{
if
(
!
directory
.
IsRoot
())
{
...
@@ -67,8 +65,6 @@ PrintDirectoryFull(Response &r, bool base, const LightDirectory &directory)
...
@@ -67,8 +65,6 @@ PrintDirectoryFull(Response &r, bool base, const LightDirectory &directory)
if
(
directory
.
mtime
>
0
)
if
(
directory
.
mtime
>
0
)
time_print
(
r
,
"Last-Modified"
,
directory
.
mtime
);
time_print
(
r
,
"Last-Modified"
,
directory
.
mtime
);
}
}
return
true
;
}
}
static
void
static
void
...
@@ -96,7 +92,7 @@ print_playlist_in_directory(Response &r, bool base,
...
@@ -96,7 +92,7 @@ print_playlist_in_directory(Response &r, bool base,
directory
->
GetPath
(),
name_utf8
);
directory
->
GetPath
(),
name_utf8
);
}
}
static
bool
static
void
PrintSongBrief
(
Response
&
r
,
Partition
&
partition
,
PrintSongBrief
(
Response
&
r
,
Partition
&
partition
,
bool
base
,
const
LightSong
&
song
)
bool
base
,
const
LightSong
&
song
)
{
{
...
@@ -106,11 +102,9 @@ PrintSongBrief(Response &r, Partition &partition,
...
@@ -106,11 +102,9 @@ PrintSongBrief(Response &r, Partition &partition,
/* this song file has an embedded CUE sheet */
/* this song file has an embedded CUE sheet */
print_playlist_in_directory
(
r
,
base
,
print_playlist_in_directory
(
r
,
base
,
song
.
directory
,
song
.
uri
);
song
.
directory
,
song
.
uri
);
return
true
;
}
}
static
bool
static
void
PrintSongFull
(
Response
&
r
,
Partition
&
partition
,
PrintSongFull
(
Response
&
r
,
Partition
&
partition
,
bool
base
,
const
LightSong
&
song
)
bool
base
,
const
LightSong
&
song
)
{
{
...
@@ -120,21 +114,18 @@ PrintSongFull(Response &r, Partition &partition,
...
@@ -120,21 +114,18 @@ PrintSongFull(Response &r, Partition &partition,
/* this song file has an embedded CUE sheet */
/* this song file has an embedded CUE sheet */
print_playlist_in_directory
(
r
,
base
,
print_playlist_in_directory
(
r
,
base
,
song
.
directory
,
song
.
uri
);
song
.
directory
,
song
.
uri
);
return
true
;
}
}
static
bool
static
void
PrintPlaylistBrief
(
Response
&
r
,
bool
base
,
PrintPlaylistBrief
(
Response
&
r
,
bool
base
,
const
PlaylistInfo
&
playlist
,
const
PlaylistInfo
&
playlist
,
const
LightDirectory
&
directory
)
const
LightDirectory
&
directory
)
{
{
print_playlist_in_directory
(
r
,
base
,
print_playlist_in_directory
(
r
,
base
,
&
directory
,
playlist
.
name
.
c_str
());
&
directory
,
playlist
.
name
.
c_str
());
return
true
;
}
}
static
bool
static
void
PrintPlaylistFull
(
Response
&
r
,
bool
base
,
PrintPlaylistFull
(
Response
&
r
,
bool
base
,
const
PlaylistInfo
&
playlist
,
const
PlaylistInfo
&
playlist
,
const
LightDirectory
&
directory
)
const
LightDirectory
&
directory
)
...
@@ -144,8 +135,6 @@ PrintPlaylistFull(Response &r, bool base,
...
@@ -144,8 +135,6 @@ PrintPlaylistFull(Response &r, bool base,
if
(
playlist
.
mtime
>
0
)
if
(
playlist
.
mtime
>
0
)
time_print
(
r
,
"Last-Modified"
,
playlist
.
mtime
);
time_print
(
r
,
"Last-Modified"
,
playlist
.
mtime
);
return
true
;
}
}
void
void
...
@@ -191,15 +180,13 @@ db_selection_print(Response &r, Partition &partition,
...
@@ -191,15 +180,13 @@ db_selection_print(Response &r, Partition &partition,
0
,
std
::
numeric_limits
<
int
>::
max
());
0
,
std
::
numeric_limits
<
int
>::
max
());
}
}
static
bool
static
void
PrintSongURIVisitor
(
Response
&
r
,
Partition
&
partition
,
const
LightSong
&
song
)
PrintSongURIVisitor
(
Response
&
r
,
Partition
&
partition
,
const
LightSong
&
song
)
{
{
song_print_uri
(
r
,
partition
,
song
);
song_print_uri
(
r
,
partition
,
song
);
return
true
;
}
}
static
bool
static
void
PrintUniqueTag
(
Response
&
r
,
TagType
tag_type
,
PrintUniqueTag
(
Response
&
r
,
TagType
tag_type
,
const
Tag
&
tag
)
const
Tag
&
tag
)
{
{
...
@@ -211,8 +198,6 @@ PrintUniqueTag(Response &r, TagType tag_type,
...
@@ -211,8 +198,6 @@ PrintUniqueTag(Response &r, TagType tag_type,
if
(
item
.
type
!=
tag_type
)
if
(
item
.
type
!=
tag_type
)
r
.
Format
(
"%s: %s
\n
"
,
r
.
Format
(
"%s: %s
\n
"
,
tag_item_names
[
item
.
type
],
item
.
value
);
tag_item_names
[
item
.
type
],
item
.
value
);
return
true
;
}
}
void
void
...
...
src/db/DatabaseQueue.cxx
View file @
f71c204e
...
@@ -27,14 +27,13 @@
...
@@ -27,14 +27,13 @@
#include <functional>
#include <functional>
static
bool
static
void
AddToQueue
(
Partition
&
partition
,
const
LightSong
&
song
)
AddToQueue
(
Partition
&
partition
,
const
LightSong
&
song
)
{
{
const
Storage
&
storage
=
*
partition
.
instance
.
storage
;
const
Storage
&
storage
=
*
partition
.
instance
.
storage
;
partition
.
playlist
.
AppendSong
(
partition
.
pc
,
partition
.
playlist
.
AppendSong
(
partition
.
pc
,
DatabaseDetachSong
(
storage
,
DatabaseDetachSong
(
storage
,
song
));
song
));
return
true
;
}
}
void
void
...
...
src/db/Helpers.cxx
View file @
f71c204e
...
@@ -67,15 +67,13 @@ StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums,
...
@@ -67,15 +67,13 @@ StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums,
}
}
}
}
static
bool
static
void
StatsVisitSong
(
DatabaseStats
&
stats
,
StringSet
&
artists
,
StringSet
&
albums
,
StatsVisitSong
(
DatabaseStats
&
stats
,
StringSet
&
artists
,
StringSet
&
albums
,
const
LightSong
&
song
)
const
LightSong
&
song
)
{
{
++
stats
.
song_count
;
++
stats
.
song_count
;
StatsVisitTag
(
stats
,
artists
,
albums
,
*
song
.
tag
);
StatsVisitTag
(
stats
,
artists
,
albums
,
*
song
.
tag
);
return
true
;
}
}
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