Add support for setting profile-update-interval for Clash subscriptions

This commit is contained in:
Tindy X 2020-08-14 11:30:07 +08:00
parent 97c89150a5
commit 66af1ad54c
No known key found for this signature in database
GPG Key ID: C6AD413169968D58

View File

@ -1643,6 +1643,7 @@ std::string subconverter(RESPONSE_CALLBACK_ARGS)
case "clash"_hash: case "clashr"_hash:
writeLog(0, argTarget == "clashr" ? "Generate target: ClashR" : "Generate target: Clash", LOG_LEVEL_INFO);
tpl_args.local_vars["clash.new_field_name"] = ext.clash_new_field_name ? "true" : "false";
response.headers["profile-update-interval"] = interval / 3600;
if(ext.nodelist)
{
YAML::Node yamlnode;
@ -2047,6 +2048,7 @@ std::string surgeConfToClash(RESPONSE_CALLBACK_ARGS)
}
clash[rule_name] = rule;
response.headers["profile-update-interval"] = gUpdateInterval / 3600;
writeLog(0, "Conversion completed.", LOG_LEVEL_INFO);
return YAML::Dump(clash);
}