mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-30 21:14:12 +00:00 
			
		
		
		
	Simplify hash steps
This commit is contained in:
		
							parent
							
								
									327694d4cf
								
							
						
					
					
						commit
						8d6d5923da
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		|  | @ -471,9 +471,8 @@ export class ImportNotesProcessorService { | ||||||
| 			for await (const file of post.object.attachment) { | 			for await (const file of post.object.attachment) { | ||||||
| 				const slashdex = file.url.lastIndexOf('/'); | 				const slashdex = file.url.lastIndexOf('/'); | ||||||
| 				const filename = file.url.substring(slashdex + 1); | 				const filename = file.url.substring(slashdex + 1); | ||||||
| 				const hash = crypto.createHash('md5'); | 				const hash = crypto.createHash('md5').update(file.url).digest('base64url'); | ||||||
| 				const urlHash = hash.update(file.url).digest('base64url'); | 				const name = `${hash}-${filename}`; | ||||||
| 				const name = `${urlHash}-${filename}`; |  | ||||||
| 				const [filePath, cleanup] = await createTemp(); | 				const [filePath, cleanup] = await createTemp(); | ||||||
| 
 | 
 | ||||||
| 				const exists = await this.driveFilesRepository.findOneBy({ name: name, userId: user.id }) ?? await this.driveFilesRepository.findOneBy({ name: name, userId: user.id, folderId: pleroFolder?.id }); | 				const exists = await this.driveFilesRepository.findOneBy({ name: name, userId: user.id }) ?? await this.driveFilesRepository.findOneBy({ name: name, userId: user.id, folderId: pleroFolder?.id }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue