Browse Source

fix: thumbnail generation failing in Other S3 providers (#9088)

* fix: thumbnail generation failing in Other S3 providers

* fix: handle relative path generation for thumbnails

* fix: regex
pull/9100/head
Anbarasu 4 months ago committed by GitHub
parent
commit
8f1b060de4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts

6
packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts

@ -133,7 +133,7 @@ export class ThumbnailGeneratorProcessor {
relativePath = decodeURI(new URL(attachment.url).pathname);
signedUrl = await PresignedUrl.getSignedUrl({
pathOrUrl: relativePath,
pathOrUrl: attachment.url,
preview: false,
filename: attachment.title,
mimetype: attachment.mimetype,
@ -143,9 +143,7 @@ export class ThumbnailGeneratorProcessor {
.data as Buffer;
}
if (relativePath.startsWith('/nc/uploads/')) {
relativePath = relativePath.replace('/nc/uploads/', '');
}
relativePath = relativePath.replace(/^.*?(?=\/noco)/, '');
return { file, relativePath };
}

Loading…
Cancel
Save