From a6ac0f89656b9ef374703d24bbb27316a705eadc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 15 Aug 2012 21:32:34 +0200 Subject: DatabasePlugin: add method VisitUniqueTags() Optimize the ProxyDatabase by invoking "list" on the peer, instead of visiting all songs. --- src/DatabasePlugin.hxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/DatabasePlugin.hxx') diff --git a/src/DatabasePlugin.hxx b/src/DatabasePlugin.hxx index 31b2a1024..a6168b628 100644 --- a/src/DatabasePlugin.hxx +++ b/src/DatabasePlugin.hxx @@ -29,6 +29,10 @@ #include "DatabaseVisitor.hxx" #include "gcc.h" +extern "C" { +#include "tag.h" +} + struct config_param; struct DatabaseSelection; struct db_visitor; @@ -82,6 +86,14 @@ public: GError **error_r) const { return Visit(selection, VisitDirectory(), visit_song, error_r); } + + /** + * Visit all unique tag values. + */ + virtual bool VisitUniqueTags(const DatabaseSelection &selection, + enum tag_type tag_type, + VisitString visit_string, + GError **error_r) const = 0; }; struct DatabasePlugin { -- cgit v1.2.3