decoder/DecoderPlugin: container_scan() returns forward_list<string>

This commit is contained in:
Max Kellermann
2016-11-22 09:33:52 +01:00
parent 114fcee2ae
commit 0abee77e62
5 changed files with 55 additions and 39 deletions

View File

@@ -96,10 +96,14 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
return false;
}
AllocatedString<> vtrack = nullptr;
unsigned int tnum = 0;
const auto v = plugin.container_scan(pathname);
if (v.empty()) {
editor.LockDeleteDirectory(contdir);
return false;
}
TagBuilder tag_builder;
while ((vtrack = plugin.container_scan(pathname, ++tnum)) != nullptr) {
for (const auto &vtrack : v) {
Song *song = Song::NewFile(vtrack.c_str(), *contdir);
// shouldn't be necessary but it's there..
@@ -126,9 +130,5 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
directory.GetPath(), vtrack.c_str());
}
if (tnum == 1) {
editor.LockDeleteDirectory(contdir);
return false;
} else
return true;
return true;
}