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
41a3fd0f
Commit
41a3fd0f
authored
Nov 22, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stats: use struct DatabaseStats
Eliminate redundant declaration.
parent
b9169a56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
25 deletions
+4
-25
Stats.cxx
src/Stats.cxx
+4
-10
Stats.hxx
src/Stats.hxx
+0
-15
No files found.
src/Stats.cxx
View file @
41a3fd0f
...
...
@@ -31,7 +31,7 @@
#include <glib.h>
static
GTimer
*
uptime
;
static
struct
s
tats
stats
;
static
DatabaseS
tats
stats
;
void
stats_global_init
(
void
)
{
...
...
@@ -51,17 +51,11 @@ void stats_update(void)
const
DatabaseSelection
selection
(
""
,
true
);
if
(
GetDatabase
()
->
GetStats
(
selection
,
stats2
,
error
))
{
stats
.
song_count
=
stats2
.
song_count
;
stats
.
song_duration
=
stats2
.
total_duration
;
stats
.
artist_count
=
stats2
.
artist_count
;
stats
.
album_count
=
stats2
.
album_count
;
stats
=
stats2
;
}
else
{
LogError
(
error
);
stats
.
song_count
=
0
;
stats
.
song_duration
=
0
;
stats
.
artist_count
=
0
;
stats
.
album_count
=
0
;
stats
.
Clear
();
}
}
...
...
@@ -80,7 +74,7 @@ stats_print(Client &client)
stats
.
song_count
,
(
long
)
g_timer_elapsed
(
uptime
,
NULL
),
(
long
)(
client
.
player_control
.
GetTotalPlayTime
()
+
0.5
),
stats
.
song
_duration
);
stats
.
total
_duration
);
if
(
db_is_simple
())
client_printf
(
client
,
...
...
src/Stats.hxx
View file @
41a3fd0f
...
...
@@ -22,21 +22,6 @@
class
Client
;
struct
stats
{
/** number of song files in the music directory */
unsigned
song_count
;
/** sum of all song durations in the music directory (in
seconds) */
unsigned
long
song_duration
;
/** number of distinct artist names in the music directory */
unsigned
artist_count
;
/** number of distinct album names in the music directory */
unsigned
album_count
;
};
void
stats_global_init
(
void
);
void
stats_global_finish
(
void
);
...
...
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