fix: only allow image files to be chosen
All checks were successful
/ check_lfs (push) Successful in 20s
On_Push / lint_fmt (push) Successful in 1m5s
On_Push / lint_clippy (push) Successful in 2m18s
On_Push / build (push) Successful in 2m1s
On_Push / deploy (push) Successful in 21s

This commit is contained in:
silver 2025-07-05 15:31:53 +01:00
parent d27befdac6
commit c4da3e9109
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -286,9 +286,19 @@ pub mod update_icon {
fn logos_filter(festival_data: &FestivalData, existing: Vec<LogoData>) -> Vec<LogoData> {
let mut filtered: Vec<LogoData> = vec![];
let allowed_files = vec![".png", ".jpeg", ".gif", ".svg"];
'outer: for logo in existing {
let name_lowercase0 = logo.name.to_ascii_lowercase();
let name_lowercase = name_lowercase0.to_str().unwrap_or_default();
let mut allowed = false;
for allowed_type in &allowed_files {
if name_lowercase.ends_with(allowed_type) {
allowed = true;
}
}
if !allowed {
continue;
}
if !festival_data.current.is_empty() {
// if its a current festival filter based on it