mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-11 03:12:44 +02:00
#178 - Making it faster
This commit is contained in:
@@ -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[] = [];
|
||||
|
||||
@@ -245,8 +245,6 @@ export class Folders {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
console.timeEnd("Check files with fs.stats");
|
||||
} catch (e) {
|
||||
// Skip the current folder
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export const ChoiceButton: React.FunctionComponent<IChoiceButtonProps> = ({onCli
|
||||
|
||||
<Menu as="span" className="-ml-px relative block">
|
||||
<Menu.Button
|
||||
className="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium text-white dark:text-vulcan-500 bg-teal-700 hover:bg-teal-800 focus:outline-none disabled:bg-gray-500"
|
||||
className="h-full inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium text-white dark:text-vulcan-500 bg-teal-700 hover:bg-teal-800 focus:outline-none disabled:bg-gray-500"
|
||||
disabled={disabled}>
|
||||
<span className="sr-only">Open options</span>
|
||||
<ChevronDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Stats } from "fs";
|
||||
import { ISizeCalculationResult } from "image-size/dist/types/interface";
|
||||
import { FileStat } from "vscode";
|
||||
|
||||
export interface MediaPaths {
|
||||
media: MediaInfo[];
|
||||
@@ -9,12 +7,12 @@ export interface MediaPaths {
|
||||
selectedFolder: string;
|
||||
}
|
||||
|
||||
export interface MediaInfo extends FileStat {
|
||||
export interface MediaInfo {
|
||||
fsPath: string;
|
||||
vsPath: string | undefined;
|
||||
stats: Stats | undefined;
|
||||
dimensions: ISizeCalculationResult | undefined;
|
||||
dimensions?: ISizeCalculationResult | undefined;
|
||||
caption?: string | undefined;
|
||||
alt?: string | undefined;
|
||||
modified?: Date | undefined;
|
||||
mtime?: Date;
|
||||
ctime?: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user