diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-29 16:53:09 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-29 16:57:44 +0100 |
commit | 005bb59797617a08804018393b5792eba1c32327 (patch) | |
tree | 45abfb7aee7944a7b83cd58b911a52e182b0d56f /test/run_input.cxx | |
parent | 88bc3a9271873dfb89c00b73766b6575299db934 (diff) |
test/run_input: move code from Scan() to input/ScanTags.cxx
Diffstat (limited to 'test/run_input.cxx')
-rw-r--r-- | test/run_input.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/run_input.cxx b/test/run_input.cxx index 0933f4f12..fc5937f68 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -26,6 +26,7 @@ #include "input/Registry.hxx" #include "input/InputPlugin.hxx" #include "input/RemoteTagScanner.hxx" +#include "input/ScanTags.hxx" #include "event/Thread.hxx" #include "thread/Cond.hxx" #include "Log.hxx" @@ -213,20 +214,15 @@ Scan(const char *uri) { DumpRemoteTagHandler handler; - input_plugins_for_each_enabled(plugin) { - if (plugin->scan_tags == nullptr) - continue; - - auto scanner = plugin->scan_tags(uri, handler); - if (scanner) { - scanner->Start(); - tag_save(stdout, handler.Wait()); - return EXIT_SUCCESS; - } + auto scanner = InputScanTags(uri, handler); + if (!scanner) { + fprintf(stderr, "Unsupported URI\n"); + return EXIT_FAILURE; } - fprintf(stderr, "Unsupported URI\n"); - return EXIT_FAILURE; + scanner->Start(); + tag_save(stdout, handler.Wait()); + return EXIT_SUCCESS; } int main(int argc, char **argv) |