Adding azw3 to icons.

This commit is contained in:
Roland 2023-02-16 08:39:34 -07:00
parent 5fb476f205
commit b18cc7f18d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 14 additions and 6 deletions

View file

@ -617,7 +617,7 @@ export function FileIcon({file, disabled = true, size = 'huge', ...props}) {
props['name'] = 'file';
props['color'] = mimetypeColor(mimetype);
if (mimetype) {
if (mimetype.startsWith('text/html') || mimetype.startsWith('application/json') || mimetype.startsWith('text/yaml')) {
if (mimetype.startsWith('text/html') || mimetype.startsWith('application/json') || mimetype.startsWith('text/yaml') || mimetype.startsWith('text/xml')) {
props['name'] = 'file code';
} else if (mimetype.startsWith('application/pdf')) {
props['name'] = 'file pdf';
@ -633,16 +633,22 @@ export function FileIcon({file, disabled = true, size = 'huge', ...props}) {
props['name'] = 'file archive';
} else if (mimetype.startsWith('application/x-iso9660-image')) {
props['name'] = 'dot circle';
} else if (mimetype.startsWith('application/epub') || mimetype.startsWith('application/x-mobipocket-ebook')) {
} else if (mimetype.startsWith('application/epub') || mimetype.startsWith('application/x-mobipocket-ebook') || mimetype.startsWith('application/vnd.amazon.mobi8-ebook')) {
props['name'] = 'book';
} else if (mimetype.startsWith('text/vtt') || mimetype.startsWith('text/srt')) {
props['name'] = 'closed captioning';
} else if (mimetype.startsWith('application/octet-stream') && lowerPath.endsWith('.dmg')) {
props['name'] = 'apple';
} else if (mimetype.startsWith('application/x-openscad') || (mimetype.startsWith('application/octet-stream') && (lowerPath.endsWith('.stl') || lowerPath.endsWith('.blend')))) {
props['name'] = 'cube';
} else if (mimetype.startsWith('application/x-dosexec') || mimetype.startsWith('application/x-msi')) {
props['name'] = 'microsoft';
} else if (mimetype.startsWith('application/octet-stream')) {
if (lowerPath.endsWith('.stl')) {
props['name'] = 'cube';
} else if (lowerPath.endsWith('.blend')) {
props['name'] = 'cube';
} else if (lowerPath.endsWith('.dmg')) {
props['name'] = 'apple';
} else if (lowerPath.endsWith('.azw3')) {
props['name'] = 'book';
}
}
}
return <Icon disabled={disabled} size={size} {...props}/>

View file

@ -153,6 +153,8 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
return 'text/srt'
if suffix.endswith('.yaml') or suffix.endswith('.yml'):
return 'text/yaml'
if suffix.endswith('.azw3'):
return 'application/vnd.amazon.mobi8-ebook'
return mimetype