mirror of https://github.com/odrling/Aegisub
Deduplicate automation autoload path, for real this time
Replaces the incorrect fix in 642251b
Fixes arch1t3cht/Aegisub#15
This commit is contained in:
parent
4f67db8dd7
commit
edae653584
|
@ -315,11 +315,14 @@ namespace Automation4 {
|
||||||
|
|
||||||
std::vector<std::future<std::unique_ptr<Script>>> script_futures;
|
std::vector<std::future<std::unique_ptr<Script>>> script_futures;
|
||||||
|
|
||||||
auto path_it = agi::Split(path, '|');
|
std::set<agi::fs::path> dirnames;
|
||||||
for (auto tok : std::set<agi::StringRange>(begin(path_it), end(path_it))) {
|
for (auto tok : agi::Split(path, '|')) {
|
||||||
auto dirname = config::path->Decode(agi::str(tok));
|
auto dirname = config::path->Decode(agi::str(tok));
|
||||||
if (!agi::fs::DirectoryExists(dirname)) continue;
|
if (!agi::fs::DirectoryExists(dirname)) continue;
|
||||||
|
|
||||||
|
if (dirnames.count(dirname)) continue;
|
||||||
|
dirnames.insert(dirname);
|
||||||
|
|
||||||
for (auto filename : agi::fs::DirectoryIterator(dirname, "*.*"))
|
for (auto filename : agi::fs::DirectoryIterator(dirname, "*.*"))
|
||||||
script_futures.emplace_back(std::async(std::launch::async, [=] {
|
script_futures.emplace_back(std::async(std::launch::async, [=] {
|
||||||
return ScriptFactory::CreateFromFile(dirname/filename, false, false);
|
return ScriptFactory::CreateFromFile(dirname/filename, false, false);
|
||||||
|
|
Loading…
Reference in New Issue