input/qobuz: implement InputPlugin::scan_tags()

This commit is contained in:
Max Kellermann
2018-01-26 18:50:13 +01:00
parent 2e32cf7b87
commit 88bc3a9271
6 changed files with 390 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include "QobuzInputPlugin.hxx"
#include "QobuzClient.hxx"
#include "QobuzTrackRequest.hxx"
#include "QobuzTagScanner.hxx"
#include "CurlInputPlugin.hxx"
#include "PluginUnavailable.hxx"
#include "input/ProxyInputStream.hxx"
@@ -192,9 +193,23 @@ OpenQobuzInput(const char *uri, Mutex &mutex, Cond &cond)
return std::make_unique<QobuzInputStream>(uri, track_id, mutex, cond);
}
static std::unique_ptr<RemoteTagScanner>
ScanQobuzTags(const char *uri, RemoteTagHandler &handler)
{
assert(qobuz_client != nullptr);
const char *track_id = ExtractQobuzTrackId(uri);
if (track_id == nullptr)
return nullptr;
return std::make_unique<QobuzTagScanner>(*qobuz_client, track_id,
handler);
}
const InputPlugin qobuz_input_plugin = {
"qobuz",
InitQobuzInput,
FinishQobuzInput,
OpenQobuzInput,
ScanQobuzTags,
};