TagFile: add TagBuilder overload with ScanGenericTags() fallback

This commit is contained in:
Max Kellermann
2016-02-26 13:18:32 +01:00
parent b1d60b5c85
commit a9130cb99c
3 changed files with 29 additions and 9 deletions

View File

@@ -19,6 +19,9 @@
#include "config.h"
#include "TagFile.hxx"
#include "tag/Generic.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "fs/Path.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
@@ -94,3 +97,15 @@ tag_file_scan(Path path_fs, const TagHandler &handler, void *handler_ctx)
return tfs.Scan(plugin);
});
}
bool
tag_file_scan(Path path, TagBuilder &builder)
{
if (!tag_file_scan(path, full_tag_handler, &builder))
return false;
if (builder.IsEmpty())
ScanGenericTags(path, full_tag_handler, &builder);
return true;
}