fix 2 electric boogaloo

This commit is contained in:
Simon
2026-03-16 00:16:07 +00:00
parent 448efeff1e
commit 1f99eec5a3

View File

@@ -8,13 +8,13 @@ use crate::util::requester::Requester;
fn normalize_image_url(endpoint: &str) -> String { fn normalize_image_url(endpoint: &str) -> String {
let endpoint = endpoint.trim_start_matches('/'); let endpoint = endpoint.trim_start_matches('/');
println!("Normalizing image URL: {endpoint}");
if endpoint.starts_with("http://") || endpoint.starts_with("https://") { if endpoint.starts_with("http://") || endpoint.starts_with("https://") {
endpoint.to_string() endpoint.to_string()
} else if endpoint.starts_with("hanime-cdn.com/") || endpoint == "hanime-cdn.com" { } else if endpoint.starts_with("hanime-cdn.com/") || endpoint == "hanime-cdn.com" {
format!("https://{endpoint}") format!("https://{endpoint}")
} else { } else {
format!("https://hanime-cdn.com/{endpoint}") format!("https://{endpoint}")
} }
} }