mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	detectFileTypeAndMime also returns the type, fixes #456
This commit is contained in:
		| @@ -456,13 +456,12 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         let { mime } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath); |         let { mime, type } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath); | ||||||
|  |         type = resolveNoteType(type); | ||||||
|         if (mime == null) { |         if (mime == null) { | ||||||
|             throw new Error("Unable to resolve mime type."); |             throw new Error("Unable to resolve mime type."); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         let type = resolveNoteType(noteMeta?.type); |  | ||||||
|  |  | ||||||
|         if (type !== 'file' && type !== 'image') { |         if (type !== 'file' && type !== 'image') { | ||||||
|             content = content.toString("utf-8"); |             content = content.toString("utf-8"); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user