Browse Source

fix: thumbnail path for workspaceIcons

pull/9722/head
mertmit 1 day ago
parent
commit
d206399257
  1. 13
      packages/nocodb/src/modules/jobs/jobs/thumbnail-generator/thumbnail-generator.processor.ts

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

@ -137,8 +137,17 @@ export class ThumbnailGeneratorProcessor {
const file = await storageAdapter.fileRead(relativePath);
// remove everything before 'nc/uploads/' (including nc/uploads/) in relativePath
relativePath = relativePath.replace(/^.*?nc[/\\]uploads[/\\]/, '');
const scopePath = scope ? scope : 'uploads';
// remove everything before 'nc/${scopePath}/' (including nc/${scopePath}/) in relativePath
relativePath = relativePath.replace(
new RegExp(`^.*?nc[/\\\\]${scopePath}[/\\\\]`),
'',
);
if (scope) {
relativePath = `${scopePath}/${relativePath}`;
}
return { file, relativePath };
}

Loading…
Cancel
Save