diff options
Diffstat (limited to 'src/db/ProxyDatabasePlugin.cxx')
-rw-r--r-- | src/db/ProxyDatabasePlugin.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx index fc99242ee..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); @@ -71,6 +74,10 @@ public: DatabaseStats &stats, Error &error) const override; + virtual time_t GetUpdateStamp() const override { + return update_stamp; + } + private: bool Configure(const config_param ¶m, Error &error); @@ -237,6 +244,7 @@ ProxyDatabase::Open(Error &error) return false; root = Directory::NewRoot(); + update_stamp = 0; return true; } @@ -631,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); |