fix: only allow image files to be chosen
This commit is contained in:
parent
d27befdac6
commit
c4da3e9109
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue