mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-25 18:32:22 +00:00
Update subexport.cpp
Some checks failed
GitHub CI / macOS ${{ matrix.arch }} Build (arm, subconverter_darwinarm, macos-14) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (x86, subconverter_darwin64, macos-13) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (amd64, subconverter_win64, x86_64, MINGW64) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (x86, subconverter_win32, i686, MINGW32) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (aarch64, subconverter_aarch64, ubuntu-latest) (push) Failing after 38s
GitHub CI / Linux ${{ matrix.arch }} Build (amd64, subconverter_linux64, ubuntu-latest) (push) Failing after 16s
GitHub CI / Linux ${{ matrix.arch }} Build (armv7, subconverter_armv7, ubuntu-latest) (push) Failing after 19s
GitHub CI / Linux ${{ matrix.arch }} Build (x86, subconverter_linux32, ubuntu-latest) (push) Failing after 22s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/386) (push) Failing after 6m49s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm/v7) (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm64) (push) Has been cancelled
Publish Docker Image / Merge (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/amd64) (push) Has been cancelled
Some checks failed
GitHub CI / macOS ${{ matrix.arch }} Build (arm, subconverter_darwinarm, macos-14) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (x86, subconverter_darwin64, macos-13) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (amd64, subconverter_win64, x86_64, MINGW64) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (x86, subconverter_win32, i686, MINGW32) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (aarch64, subconverter_aarch64, ubuntu-latest) (push) Failing after 38s
GitHub CI / Linux ${{ matrix.arch }} Build (amd64, subconverter_linux64, ubuntu-latest) (push) Failing after 16s
GitHub CI / Linux ${{ matrix.arch }} Build (armv7, subconverter_armv7, ubuntu-latest) (push) Failing after 19s
GitHub CI / Linux ${{ matrix.arch }} Build (x86, subconverter_linux32, ubuntu-latest) (push) Failing after 22s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/386) (push) Failing after 6m49s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm/v7) (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm64) (push) Has been cancelled
Publish Docker Image / Merge (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/amd64) (push) Has been cancelled
This commit is contained in:
@@ -662,7 +662,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
||||
yamlnode["Proxy"] = proxies;
|
||||
|
||||
|
||||
for (const ProxyGroupConfig &x: extra_proxy_group) {
|
||||
for(const ProxyGroupConfig &x : extra_proxy_group)
|
||||
{
|
||||
YAML::Node singlegroup;
|
||||
string_array filtered_nodelist;
|
||||
|
||||
@@ -672,87 +673,70 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
||||
else
|
||||
singlegroup["type"] = x.TypeStr();
|
||||
|
||||
switch (x.Type) {
|
||||
case ProxyGroupType::Select:
|
||||
case ProxyGroupType::Relay:
|
||||
break;
|
||||
case ProxyGroupType::LoadBalance:
|
||||
singlegroup["strategy"] = x.StrategyStr();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::URLTest:
|
||||
if (!x.Lazy.is_undef())
|
||||
singlegroup["lazy"] = x.Lazy.get();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::Fallback:
|
||||
singlegroup["url"] = x.Url;
|
||||
if (x.Interval > 0)
|
||||
singlegroup["interval"] = x.Interval;
|
||||
if (x.Tolerance > 0)
|
||||
singlegroup["tolerance"] = x.Tolerance;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
switch (x.Type) {
|
||||
case ProxyGroupType::Select:
|
||||
case ProxyGroupType::Relay:
|
||||
break;
|
||||
case ProxyGroupType::LoadBalance:
|
||||
singlegroup["strategy"] = x.StrategyStr();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::Smart:
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::URLTest:
|
||||
if (!x.Lazy.is_undef())
|
||||
singlegroup["lazy"] = x.Lazy.get();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::Fallback:
|
||||
singlegroup["url"] = x.Url;
|
||||
if (x.Interval > 0)
|
||||
singlegroup["interval"] = x.Interval;
|
||||
if (x.Tolerance > 0)
|
||||
singlegroup["tolerance"] = x.Tolerance;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (!x.DisableUdp.is_undef())
|
||||
singlegroup["disable-udp"] = x.DisableUdp.get();
|
||||
|
||||
for (const auto &y: x.Proxies)
|
||||
groupGenerate(y, nodelist, filtered_nodelist, true, ext);
|
||||
|
||||
if (!x.UsingProvider.empty())
|
||||
singlegroup["use"] = x.UsingProvider;
|
||||
else {
|
||||
if (filtered_nodelist.empty())
|
||||
filtered_nodelist.emplace_back("DIRECT");
|
||||
}
|
||||
if (!filtered_nodelist.empty())
|
||||
singlegroup["proxies"] = filtered_nodelist;
|
||||
if (group_block)
|
||||
singlegroup.SetStyle(YAML::EmitterStyle::Block);
|
||||
else
|
||||
singlegroup.SetStyle(YAML::EmitterStyle::Flow);
|
||||
|
||||
bool replace_flag = false;
|
||||
for (auto &&original_group: original_groups) {
|
||||
if (original_group["name"].as<std::string>() == x.Name) {
|
||||
original_group.reset(singlegroup);
|
||||
replace_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!replace_flag)
|
||||
original_groups.push_back(singlegroup);
|
||||
switch(x.Type)
|
||||
{
|
||||
case ProxyGroupType::Select:
|
||||
case ProxyGroupType::Relay:
|
||||
break;
|
||||
case ProxyGroupType::LoadBalance:
|
||||
singlegroup["strategy"] = x.StrategyStr();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::Smart:
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::URLTest:
|
||||
if(!x.Lazy.is_undef())
|
||||
singlegroup["lazy"] = x.Lazy.get();
|
||||
[[fallthrough]];
|
||||
case ProxyGroupType::Fallback:
|
||||
singlegroup["url"] = x.Url;
|
||||
if(x.Interval > 0)
|
||||
singlegroup["interval"] = x.Interval;
|
||||
if(x.Tolerance > 0)
|
||||
singlegroup["tolerance"] = x.Tolerance;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (group_compact)
|
||||
original_groups.SetStyle(YAML::EmitterStyle::Flow);
|
||||
if(!x.DisableUdp.is_undef())
|
||||
singlegroup["disable-udp"] = x.DisableUdp.get();
|
||||
|
||||
if (ext.clash_new_field_name)
|
||||
yamlnode["proxy-groups"] = original_groups;
|
||||
for(const auto& y : x.Proxies)
|
||||
groupGenerate(y, nodelist, filtered_nodelist, true, ext);
|
||||
|
||||
if(!x.UsingProvider.empty())
|
||||
singlegroup["use"] = x.UsingProvider;
|
||||
else
|
||||
yamlnode["Proxy Group"] = original_groups;
|
||||
{
|
||||
if(filtered_nodelist.empty())
|
||||
filtered_nodelist.emplace_back("DIRECT");
|
||||
}
|
||||
if(!filtered_nodelist.empty())
|
||||
singlegroup["proxies"] = filtered_nodelist;
|
||||
if(group_block)
|
||||
singlegroup.SetStyle(YAML::EmitterStyle::Block);
|
||||
else
|
||||
singlegroup.SetStyle(YAML::EmitterStyle::Flow);
|
||||
|
||||
bool replace_flag = false;
|
||||
for(auto && original_group : original_groups)
|
||||
{
|
||||
if(original_group["name"].as<std::string>() == x.Name)
|
||||
{
|
||||
original_group.reset(singlegroup);
|
||||
replace_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!replace_flag)
|
||||
original_groups.push_back(singlegroup);
|
||||
}
|
||||
if(group_compact)
|
||||
original_groups.SetStyle(YAML::EmitterStyle::Flow);
|
||||
|
||||
if(ext.clash_new_field_name)
|
||||
yamlnode["proxy-groups"] = original_groups;
|
||||
else
|
||||
yamlnode["Proxy Group"] = original_groups;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user