mirror of
https://github.com/daledesilva/obsidian_google-keep-import.git
synced 2026-07-22 07:50:23 +00:00
Refined the accepted files
This commit is contained in:
parent
0cfee1fc64
commit
aae1df10f2
2 changed files with 15 additions and 6 deletions
|
|
@ -123,13 +123,22 @@ export async function importFiles(plugin: KeepPlugin, files: Array<Object>) {
|
|||
if(file.type === 'application/json') {
|
||||
if(!noteFolder) noteFolder = await getOrCreateFolder(settings.folderNames.notes, vault);
|
||||
result = await importJson(vault, noteFolder, file, settings);
|
||||
} else {
|
||||
// image/png
|
||||
// video/3gpp
|
||||
// image/jpeg
|
||||
// *
|
||||
} else if( file.type === 'video/3gpp' ||
|
||||
file.type === 'audio/amr' ||
|
||||
file.type === 'image/png' ||
|
||||
file.type === 'image/jpeg' ||
|
||||
file.type === 'image/jpg' ||
|
||||
file.type === 'image/webp' ||
|
||||
file.type === 'image/gif'
|
||||
) {
|
||||
if(!assetFolder) assetFolder = await getOrCreateFolder(settings.folderNames.attachments, vault);
|
||||
result = await importBinaryFile(vault, assetFolder, file);
|
||||
} else {
|
||||
result = {
|
||||
keepFilename: file.name,
|
||||
outcome: ImportOutcomeType.CreationError,
|
||||
details: `This file wasn't imported because this plugin doesn\'t support importing ${file.type} files.`,
|
||||
}
|
||||
}
|
||||
|
||||
// Populate output log on error
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class StartImportModal extends Modal {
|
|||
|
||||
titleEl.setText('Import Google Keep backup');
|
||||
|
||||
contentEl.createEl('p', {text: 'Here you can upload a set of jsons output from a Google Keep backup.'});
|
||||
contentEl.createEl('p', {text: 'Here you can upload a set of jsons output from a Google Keep backup (<a href="https://takeout.google.com/">Google Takeout</a>).'});
|
||||
contentEl.createEl('p', {text: 'Upload each json one at a time or all together. You should also upload any attachments in the backup as well such as png\'s jpgs, etc.'});
|
||||
contentEl.createEl('p', {text: 'If you import attachments or jsons separately and close this dialog, they will will automatically link together once their counterparts are imported later provided you haven\'t changed the names of attachments or modified the markdown embeds in the notes.'});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue