From ebc1e8b8fa42c428356cf3fd21216eb5a8c1068c Mon Sep 17 00:00:00 2001 From: sunilnatraj <30485122+sunilnatraj@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:29:14 +0530 Subject: [PATCH 1/2] Issue 94 File thumbnails don't show up after upload of new files Projects uploading new media do not contain the File prefix in the file name. Added check to get proper filename when the prefix File: is missing. --- module/scripts/project/thumbnail-renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/scripts/project/thumbnail-renderer.js b/module/scripts/project/thumbnail-renderer.js index 1dca4d9..30e7c11 100644 --- a/module/scripts/project/thumbnail-renderer.js +++ b/module/scripts/project/thumbnail-renderer.js @@ -61,7 +61,7 @@ class ThumbnailReconRenderer extends ReconCellRenderer { .attr("target", "_blank") .appendTo(divContentRecon); - var bareFileName = match.name.substr('File:'.length).replaceAll(' ', '_'); + var bareFileName = match.name.includes('File:') ? match.name.substr('File:'.length).replaceAll(' ', '_') : match.name.replaceAll(' ', '_'); var fileNameParts = bareFileName.split('.'); var extension = fileNameParts[fileNameParts.length - 1].toLowerCase(); if (!self.supportedExtensions.includes(extension)) { From a86bca74a9b787f4e9f6633c39857de7794fc52f Mon Sep 17 00:00:00 2001 From: sunilnatraj <30485122+sunilnatraj@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:26:13 +0530 Subject: [PATCH 2/2] Update module/scripts/project/thumbnail-renderer.js Co-authored-by: Antonin Delpeuch --- module/scripts/project/thumbnail-renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/scripts/project/thumbnail-renderer.js b/module/scripts/project/thumbnail-renderer.js index 30e7c11..ae72505 100644 --- a/module/scripts/project/thumbnail-renderer.js +++ b/module/scripts/project/thumbnail-renderer.js @@ -61,7 +61,7 @@ class ThumbnailReconRenderer extends ReconCellRenderer { .attr("target", "_blank") .appendTo(divContentRecon); - var bareFileName = match.name.includes('File:') ? match.name.substr('File:'.length).replaceAll(' ', '_') : match.name.replaceAll(' ', '_'); + var bareFileName = (match.name.startsWith('File:') ? match.name.substr('File:'.length) : match.name).replaceAll(' ', '_'); var fileNameParts = bareFileName.split('.'); var extension = fileNameParts[fileNameParts.length - 1].toLowerCase(); if (!self.supportedExtensions.includes(extension)) {