Updated mime-types

This commit is contained in:
Dale de Silva 2023-03-15 22:06:20 +11:00
parent 03d85bf063
commit ae977725e7
3 changed files with 27 additions and 23 deletions

View file

@ -144,30 +144,33 @@ export class FileImporter {
file.type === 'audio/amr' ||
file.type === 'image/png' ||
file.type === 'image/jpeg' ||
file.type === 'image/jpg' ||
file.type === 'image/webp' ||
file.type === 'image/gif';
// TODO: Check all these mim-types here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
const fileIsBinaryAndSupportedByObsidian = file.type === 'image/png' ||
file.type === 'image/webp' ||
file.type === 'image/jpg' ||
file.type === 'image/jpeg' ||
file.type === 'image/gif' ||
file.type === 'image/bmp' ||
file.type === 'image/svg+xml' ||
file.type === 'video/mp3' ||
file.type === 'video/webm' ||
file.type === 'video/wav' ||
file.type === 'video/m4a' ||
file.type === 'video/ogg' ||
file.type === 'video/3gpp' ||
file.type === 'video/flac' ||
file.type === 'video/mp4' ||
file.type === 'video/webm' ||
file.type === 'video/ogv' ||
file.type === 'video/mov' ||
file.type === 'video/mkv' ||
// Based on accepted file formats listed here: https://help.obsidian.md/Advanced+topics/Accepted+file+formats
const fileIsBinaryAndSupportedByObsidian = // Image files
file.type === 'image/png' ||
file.type === 'image/webp' ||
file.type === 'image/jpeg' || // .jpg or .jpeg
file.type === 'image/gif' ||
file.type === 'image/bmp' ||
file.type === 'image/svg+xml' ||
// Audio files
file.type === 'audio/mpeg' || // .m4a
file.type === 'audio/m4a' || // .m4a
file.type === 'audio/webm' ||
file.type === 'audio/wav' ||
file.type === 'audio/ogg' ||
file.type === 'audio/3gpp' ||
file.type === 'audio/x-flac' ||
// Video files
file.type === 'video/mp4' ||
file.type === 'video/webm' ||
file.type === 'video/ogg' || // .ogv
file.type === 'video/3gpp' || // .3gp
file.type === 'video/quicktime' || // .mov
file.type === 'video/x-matroska' || // .mkv
// Other files
file.type === 'application/pdf';

View file

@ -57,9 +57,10 @@ export default class MyPlugin extends Plugin {
}
// Run when deactivating or uninstalling a plugin
onunload() {
// TODO: Make sure to stop anything here
}
async loadSettings() {

View file

@ -52,7 +52,7 @@ export class KeepImportSettingTab extends PluginSettingTab {
new Setting(containerEl)
.setClass('uo_setting')
.setName('Note creation date')
.setDesc('Should the imported not have a creation date set to the same date it was created on in Google Keep, or should it change to the date it was imported into Obsidian on?')
.setDesc('Should the imported note have a creation date set to the Google Keep note\'s creation date, or the date imported into Obsidian?')
.addDropdown((dropdown) => {
dropdown.addOption(CreatedDateTypes.googleKeep, CreatedDateTypes.googleKeep);
dropdown.addOption(CreatedDateTypes.import, CreatedDateTypes.import);