Browse Source

fix: thumbnail path for workspaceIcons

pull/9722/head
mertmit 5 days 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); const file = await storageAdapter.fileRead(relativePath);
// remove everything before 'nc/uploads/' (including nc/uploads/) in relativePath const scopePath = scope ? scope : 'uploads';
relativePath = relativePath.replace(/^.*?nc[/\\]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 }; return { file, relativePath };
} }

Loading…
Cancel
Save