diff options
author | Max Kellermann <max@duempel.org> | 2013-11-22 00:45:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-22 00:45:27 +0100 |
commit | d22acc59c928bf4fd96eb569897bf6f64ae7df7a (patch) | |
tree | 1d875fb8a252dfc4ff15c250549f32b253fd0716 /src | |
parent | c064e8d62f0d2b46159570f21708c2546970718d (diff) | |
download | mpd-d22acc59c928bf4fd96eb569897bf6f64ae7df7a.tar.gz mpd-d22acc59c928bf4fd96eb569897bf6f64ae7df7a.tar.xz mpd-d22acc59c928bf4fd96eb569897bf6f64ae7df7a.zip |
db/proxy: implement method GetUpdateStamp()
Diffstat (limited to '')
-rw-r--r-- | src/db/ProxyDatabasePlugin.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index d4861623f..00b5d445f 100644 --- a/src/db/ProxyDatabasePlugin.cxx +++ b/src/db/ProxyDatabasePlugin.cxx @@ -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 ¶m, 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); |