quick hack to work around non-existent document support ;3
This commit is contained in:
parent
c83b754b9b
commit
9a0113d1dc
1 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue