Decode percent-encoded tags and filter release artifacts

This commit is contained in:
2026-07-08 21:14:00 +03:00
parent f6b722b22a
commit 2e80f7b8eb
8 changed files with 179 additions and 9 deletions
+10 -2
View File
@@ -96,7 +96,10 @@ impl JsonStorage {
}
pub fn read_local_singbox_config(&self) -> io::Result<LocalSingBoxConfig> {
self.read_json_or_default(&self.paths.local_singbox_file)
let mut config: LocalSingBoxConfig =
self.read_json_or_default(&self.paths.local_singbox_file)?;
config.normalize_percent_encoded_tags();
Ok(config)
}
pub fn write_local_singbox_config(&self, config: &LocalSingBoxConfig) -> io::Result<()> {
@@ -104,7 +107,12 @@ impl JsonStorage {
}
pub fn read_singbox_subscription_cache(&self) -> io::Result<Option<SubscriptionCache>> {
self.read_optional_json(&self.paths.singbox_subscription_cache_file)
let mut cache = self
.read_optional_json::<SubscriptionCache>(&self.paths.singbox_subscription_cache_file)?;
if let Some(cache) = cache.as_mut() {
cache.normalize_percent_encoded_tags();
}
Ok(cache)
}
pub fn write_singbox_subscription_cache(&self, cache: &SubscriptionCache) -> io::Result<()> {