DatabasePlugin: add method VisitUniqueTags()

Optimize the ProxyDatabase by invoking "list" on the peer, instead of
visiting all songs.
This commit is contained in:
Max Kellermann
2012-08-15 21:32:34 +02:00
parent 4e1eb03287
commit a6ac0f8965
9 changed files with 216 additions and 53 deletions

View File

@@ -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 {