From 6a313fcc8ab621a8e32d7842dcb398045a4c5dd3 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 18 Nov 2021 19:53:37 +0100 Subject: [PATCH] #178 - Making it faster --- src/commands/Dashboard.ts | 5 ++--- src/commands/Folders.ts | 2 -- src/dashboardWebView/components/ChoiceButton.tsx | 2 +- src/models/MediaPaths.ts | 10 ++++------ 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/commands/Dashboard.ts b/src/commands/Dashboard.ts index 8fcb88ac..459c57d9 100644 --- a/src/commands/Dashboard.ts +++ b/src/commands/Dashboard.ts @@ -437,15 +437,14 @@ export class Dashboard { return { ...file, - stats: statSync(file.fsPath), dimensions: imageSize(file.fsPath), ...metadata }; } catch (e) { - return {...file, stats: undefined}; + return {...file}; } }); - files = files.filter(f => f.stats !== undefined); + files = files.filter(f => f.mtime !== undefined); // Retrieve all the folders let allContentFolders: string[] = []; diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 7401056c..19653ab2 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -245,8 +245,6 @@ export class Folders { }); } } - - console.timeEnd("Check files with fs.stats"); } catch (e) { // Skip the current folder } diff --git a/src/dashboardWebView/components/ChoiceButton.tsx b/src/dashboardWebView/components/ChoiceButton.tsx index 430d0b6c..c027d36b 100644 --- a/src/dashboardWebView/components/ChoiceButton.tsx +++ b/src/dashboardWebView/components/ChoiceButton.tsx @@ -28,7 +28,7 @@ export const ChoiceButton: React.FunctionComponent = ({onCli Open options