aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-29 23:16:46 +0200
committerMax Kellermann <max@duempel.org>2014-07-29 23:35:09 +0200
commit12b5494906585297173c995fa4ed4ea8360b7ff5 (patch)
treeb2282c2e9bbeb37643a9f9d4b5f3eea00b7bbfd0
parentaa0f06d6b712b1fe40536714ecdb2dd968417be3 (diff)
downloadmpd-12b5494906585297173c995fa4ed4ea8360b7ff5.tar.gz
mpd-12b5494906585297173c995fa4ed4ea8360b7ff5.tar.xz
mpd-12b5494906585297173c995fa4ed4ea8360b7ff5.zip
db/proxy: implement Update()
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx19
2 files changed, 20 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8b85889d9..abfdf3a80 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ ver 0.19 (not yet released)
- "list" and "count" allow grouping
* database
- proxy: forward "idle" events
+ - proxy: forward the "update" command
- proxy: copy "Last-Modified" from remote directories
- upnp: new plugin
- cancel the update on shutdown
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index 918e6be49..0b358c0ba 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -120,6 +120,9 @@ public:
DatabaseStats &stats,
Error &error) const override;
+ virtual unsigned Update(const char *uri_utf8, bool discard,
+ Error &error) override;
+
virtual time_t GetUpdateStamp() const override {
return update_stamp;
}
@@ -809,6 +812,22 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
return true;
}
+unsigned
+ProxyDatabase::Update(const char *uri_utf8, bool discard,
+ Error &error)
+{
+ if (!EnsureConnected(error))
+ return 0;
+
+ unsigned id = discard
+ ? mpd_run_rescan(connection, uri_utf8)
+ : mpd_run_update(connection, uri_utf8);
+ if (id == 0)
+ CheckError(connection, error);
+
+ return id;
+}
+
const DatabasePlugin proxy_db_plugin = {
"proxy",
DatabasePlugin::FLAG_REQUIRE_STORAGE,