quick hack to work around non-existent document support ;3

This commit is contained in:
Lynne Megido 2021-02-22 02:32:38 +10:00
parent c83b754b9b
commit 9a0113d1dc
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -2,6 +2,7 @@ use std::fs::File;
use std::io;
use std::io::{Read, Seek, SeekFrom};
use std::path::Path;
use std::str::FromStr;
use cached::cached;
use mime_guess::Mime;
@ -85,6 +86,19 @@ cached! {
// to have valid extensions.
[vec![String::from("xml"), String::from("svg")], possible_exts].concat()
} else if mime == Mime::from_str("application/zip").unwrap() {
// until proper document support is added, treat all common document extensions as zips
[vec![
String::from("zip"),
String::from("docx"),
String::from("pptx"),
String::from("xlsx"),
String::from("odt"),
String::from("ods"),
String::from("odp"),
String::from("pages"),
String::from("key"),
String::from("numbers")], possible_exts].concat()
} else {
possible_exts
})