Fix file selection dialog extensions only filtering lowercase

TG-108 #closed

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/18/head
trivernis 3 years ago
parent 71d4287246
commit a94cc48a5c
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -6,6 +6,12 @@ import {DialogFilter} from "@tauri-apps/api/dialog";
import {FileOsMetadata} from "../../../../../../api/api-types/files"; import {FileOsMetadata} from "../../../../../../api/api-types/files";
import {ImportTabState} from "../../../../../models/state/ImportTabState"; import {ImportTabState} from "../../../../../models/state/ImportTabState";
const IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "bmp", "gif"];
const VIDEO_EXTENSIONS = ["mp4", "mkv", "wmv", "avi", "webm"];
const AUDIO_EXTENSIONS = ["mp3", "ogg", "wav", "flac", "aac"];
const DOCUMENT_EXTENSIONS = ["pdf", "doc", "docx", "odf"];
const TEXT_EXTENSIONS = ["txt", "md"];
@Component({ @Component({
selector: "app-filesystem-import", selector: "app-filesystem-import",
templateUrl: "./filesystem-import.component.html", templateUrl: "./filesystem-import.component.html",
@ -20,14 +26,11 @@ export class FilesystemImportComponent implements OnInit {
public files: FileOsMetadata[] = []; public files: FileOsMetadata[] = [];
public importOptions = new AddFileOptions(); public importOptions = new AddFileOptions();
public filters: DialogFilter[] = [ public filters: DialogFilter[] = [
{ { name: "Images", extensions: [...IMAGE_EXTENSIONS, ...IMAGE_EXTENSIONS.map(e => e.toUpperCase())] },
name: "Images", { name: "Videos", extensions: [...VIDEO_EXTENSIONS, ...VIDEO_EXTENSIONS.map(e => e.toUpperCase())] },
extensions: ["png", "jpg", "jpeg", "webp", "bmp", "gif"] { name: "Audio", extensions: [...AUDIO_EXTENSIONS, ...AUDIO_EXTENSIONS.map(e => e.toUpperCase())] },
}, { name: "Documents", extensions: [...DOCUMENT_EXTENSIONS, ...DOCUMENT_EXTENSIONS.map(e => e.toUpperCase())] },
{ name: "Videos", extensions: ["mp4", "mkv", "wmv", "avi", "webm"] }, { name: "Text", extensions: [...TEXT_EXTENSIONS, ...TEXT_EXTENSIONS.map(e => e.toUpperCase())] },
{ name: "Audio", extensions: ["mp3", "ogg", "wav", "flac", "aac"] },
{ name: "Documents", extensions: ["pdf", "doc", "docx", "odf"] },
{ name: "Text", extensions: ["txt", "md"] },
{ name: "All", extensions: ["*"] } { name: "All", extensions: ["*"] }
]; ];

Loading…
Cancel
Save