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
d22acc59
Commit
d22acc59
authored
Nov 22, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/proxy: implement method GetUpdateStamp()
parent
c064e8d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
NEWS
NEWS
+1
-0
ProxyDatabasePlugin.cxx
src/db/ProxyDatabasePlugin.cxx
+7
-2
No files found.
NEWS
View file @
d22acc59
...
...
@@ -4,6 +4,7 @@ ver 0.18.5 (20??/??/??)
- fix crash on "stats" without db_file/music_directory
* database
- proxy: auto-reload statistics
- proxy: provide "db_update" in "stats" response
* decoder
- fluidsynth: auto-detect by default
* fix ia64, mipsel and other little-endian architectures
...
...
src/db/ProxyDatabasePlugin.cxx
View file @
d22acc59
...
...
@@ -46,6 +46,9 @@ class ProxyDatabase : public Database {
struct
mpd_connection
*
connection
;
Directory
*
root
;
/* this is mutable because GetStats() must be "const" */
mutable
time_t
update_stamp
;
public
:
static
Database
*
Create
(
const
config_param
&
param
,
Error
&
error
);
...
...
@@ -72,8 +75,7 @@ public:
Error
&
error
)
const
override
;
virtual
time_t
GetUpdateStamp
()
const
override
{
// TODO: implement
return
0
;
return
update_stamp
;
}
private
:
...
...
@@ -242,6 +244,7 @@ ProxyDatabase::Open(Error &error)
return
false
;
root
=
Directory
::
NewRoot
();
update_stamp
=
0
;
return
true
;
}
...
...
@@ -636,6 +639,8 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
if
(
stats2
==
nullptr
)
return
CheckError
(
connection
,
error
);
update_stamp
=
(
time_t
)
mpd_stats_get_db_update_time
(
stats2
);
stats
.
song_count
=
mpd_stats_get_number_of_songs
(
stats2
);
stats
.
total_duration
=
mpd_stats_get_db_play_time
(
stats2
);
stats
.
artist_count
=
mpd_stats_get_number_of_artists
(
stats2
);
...
...
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