Skip to content

Commit

Permalink
Update filetypes for hydrus v576
Browse files Browse the repository at this point in the history
  • Loading branch information
floogulinc committed May 28, 2024
1 parent afb8c16 commit 87c8da1
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/app/hydrus-file-mimes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export enum HydrusFiletype {
APPLICATION_MICROSOFT_OPEN_XML_DOCX = 76,
APPLICATION_MICROSOFT_OPEN_XML_XLSX = 77,
APPLICATION_MICROSOFT_OPEN_XML_PPTX = 78,
UNDETERMINED_OLE = 79,
APPLICATION_DOC = 80,
APPLICATION_XLS = 81,
APPLICATION_PPT = 82,
APPLICATION_OCTET_STREAM = 100,
APPLICATION_UNKNOWN = 101
}
Expand Down Expand Up @@ -124,6 +128,9 @@ const searchableFileTypes = [
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX,
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX,
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX,
HydrusFiletype.APPLICATION_DOC,
HydrusFiletype.APPLICATION_XLS,
HydrusFiletype.APPLICATION_PPT,
HydrusFiletype.APPLICATION_EPUB,
HydrusFiletype.APPLICATION_DJVU,
HydrusFiletype.APPLICATION_RTF,
Expand Down Expand Up @@ -214,10 +221,13 @@ const APPLICATIONS = [
HydrusFiletype.APPLICATION_FLASH,
HydrusFiletype.APPLICATION_PDF,
HydrusFiletype.APPLICATION_EPUB,
HydrusFiletype.APPLICATION_DJVU,
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX,
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX,
HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX,
HydrusFiletype.APPLICATION_DJVU,
HydrusFiletype.APPLICATION_DOC,
HydrusFiletype.APPLICATION_XLS,
HydrusFiletype.APPLICATION_PPT,
HydrusFiletype.APPLICATION_RTF,
]

Expand Down Expand Up @@ -288,6 +298,9 @@ export const mime_string_lookup: Record<HydrusFiletype, string> = {
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX] : 'docx',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX] : 'xlsx',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX] : 'pptx',
[HydrusFiletype.APPLICATION_DOC] : 'doc',
[HydrusFiletype.APPLICATION_XLS] : 'xls',
[HydrusFiletype.APPLICATION_PPT] : 'ppt',
[HydrusFiletype.APPLICATION_EPUB] : 'epub',
[HydrusFiletype.APPLICATION_DJVU] : 'djvu',
[HydrusFiletype.APPLICATION_RTF]: 'rtf',
Expand Down Expand Up @@ -331,6 +344,7 @@ export const mime_string_lookup: Record<HydrusFiletype, string> = {
[HydrusFiletype.UNDETERMINED_WM] : 'wma or wmv',
[HydrusFiletype.UNDETERMINED_MP4] : 'mp4 with or without audio',
[HydrusFiletype.UNDETERMINED_PNG] : 'png or apng',
[HydrusFiletype.UNDETERMINED_OLE] : 'ole file',
[HydrusFiletype.UNDETERMINED_GIF] : 'animated or static gif',
[HydrusFiletype.APPLICATION_UNKNOWN] : 'unknown filetype',
[HydrusFiletype.GENERAL_APPLICATION] : 'application',
Expand Down Expand Up @@ -372,6 +386,9 @@ const mime_mimetype_string_lookup: Record<HydrusFiletype, string> = {
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX] : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX] : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX] : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
[HydrusFiletype.APPLICATION_DOC] : 'application/msword',
[HydrusFiletype.APPLICATION_XLS] : 'application/vnd.ms-excel',
[HydrusFiletype.APPLICATION_PPT] : 'application/vnd.ms-powerpoint',
[HydrusFiletype.APPLICATION_EPUB] : 'application/epub+zip',
[HydrusFiletype.APPLICATION_DJVU] : 'image/vnd.djvu',
[HydrusFiletype.APPLICATION_RTF] : 'application/rtf',
Expand Down Expand Up @@ -412,6 +429,7 @@ const mime_mimetype_string_lookup: Record<HydrusFiletype, string> = {
[HydrusFiletype.VIDEO_OGV] : 'video/ogg',
[HydrusFiletype.VIDEO_REALMEDIA] : 'video/vnd.rn-realvideo',
[HydrusFiletype.VIDEO_WEBM] : 'video/webm',
[HydrusFiletype.UNDETERMINED_OLE] : 'application/x-ole-storage',
[HydrusFiletype.APPLICATION_UNKNOWN] : 'unknown filetype',
[HydrusFiletype.GENERAL_APPLICATION] : 'application',
[HydrusFiletype.GENERAL_APPLICATION_ARCHIVE] : 'archive',
Expand Down Expand Up @@ -455,6 +473,9 @@ const mime_ext_lookup: Partial<Record<HydrusFiletype, string>> = {
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX] : '.docx',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX] : '.xlsx',
[HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX] : '.pptx',
[HydrusFiletype.APPLICATION_DOC] : '.doc',
[HydrusFiletype.APPLICATION_XLS] : '.xls',
[HydrusFiletype.APPLICATION_PPT] : '.ppt',
[HydrusFiletype.APPLICATION_EPUB] : '.epub',
[HydrusFiletype.APPLICATION_DJVU] : '.djvu',
[HydrusFiletype.APPLICATION_RTF] : '.rtf',
Expand Down Expand Up @@ -537,6 +558,13 @@ const mime_enum_lookup: Record<string, HydrusFiletype> = {
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' : HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_DOCX,
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' : HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_XLSX,
'application/vnd.openxmlformats-officedocument.presentationml.presentation' : HydrusFiletype.APPLICATION_MICROSOFT_OPEN_XML_PPTX,
'application/msword' : HydrusFiletype.APPLICATION_DOC,
'application/vnd.ms-word' : HydrusFiletype.APPLICATION_DOC,
'application/vnd.ms-excel' : HydrusFiletype.APPLICATION_XLS,
'application/msexcel' : HydrusFiletype.APPLICATION_XLS,
'application/vnd.ms-powerpoint' : HydrusFiletype.APPLICATION_PPT,
'application/powerpoint' : HydrusFiletype.APPLICATION_PPT,
'application/mspowerpoint' : HydrusFiletype.APPLICATION_PPT,
'application/epub+zip' : HydrusFiletype.APPLICATION_EPUB,
'image/vnd.djvu' : HydrusFiletype.APPLICATION_DJVU,
'image/vnd.djvu+multipage' : HydrusFiletype.APPLICATION_DJVU,
Expand Down Expand Up @@ -579,6 +607,7 @@ const mime_enum_lookup: Record<string, HydrusFiletype> = {
'application/vnd.rn-realmedia' : HydrusFiletype.VIDEO_REALMEDIA,
'video/webm' : HydrusFiletype.VIDEO_WEBM,
'video' : HydrusFiletype.GENERAL_VIDEO,
'application/x-ole-storage' : HydrusFiletype.UNDETERMINED_OLE,
'unknown filetype' : HydrusFiletype.APPLICATION_UNKNOWN
}

Expand Down

0 comments on commit 87c8da1

Please sign in to comment.