mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	detectFileTypeAndMime also returns the type, fixes #456
This commit is contained in:
		
							parent
							
								
									d4fa7e3fd2
								
							
						
					
					
						commit
						91095e8d4e
					
				| @ -456,13 +456,12 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         let { mime } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath); | ||||
|         let { mime, type } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath); | ||||
|         type = resolveNoteType(type); | ||||
|         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
	 perf3ct
						perf3ct