merge: fix: keep alt text of file if present (!418)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/418

Approved-by: Amelia Yukii <amelia.yukii@shourai.de>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
Marie 2024-02-19 01:27:08 +00:00
commit 6ef2d471e9

View file

@ -419,6 +419,10 @@ export class ImportNotesProcessorService {
const name = file.url.substring(slashdex + 1); const name = file.url.substring(slashdex + 1);
const exists = await this.driveFilesRepository.findOneBy({ name: name, userId: user.id }); const exists = await this.driveFilesRepository.findOneBy({ name: name, userId: user.id });
if (exists) { if (exists) {
if (file.name) {
this.driveService.updateFile(exists, { comment: file.name }, user);
}
files.push(exists); files.push(exists);
} }
} }