mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
Merge pull request #458 from TriliumNext/zip-import-image-fix
Resolve MIME type not being used when creating new note correctly, upon zip import
This commit is contained in:
commit
469c1ceb07
@ -456,13 +456,12 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
|
||||
return;
|
||||
}
|
||||
|
||||
let { mime } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);
|
||||
let { mime, type: detectedType } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);
|
||||
const type = resolveNoteType(detectedType);
|
||||
if (mime == null) {
|
||||
throw new Error("Unable to resolve mime type.");
|
||||
}
|
||||
|
||||
let type = resolveNoteType(noteMeta?.type);
|
||||
|
||||
if (type !== 'file' && type !== 'image') {
|
||||
content = content.toString("utf-8");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user