Issue: Check why media files are not loading in the latest version #957

This commit is contained in:
Elio Struyf
2025-06-17 10:00:24 +02:00
parent d57d0c5d45
commit ef9f1f7f56
3 changed files with 10 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
- [#933](https://github.com/estruyf/vscode-front-matter/issues/933): Timezone setting integration in the DateTime field
- [#942](https://github.com/estruyf/vscode-front-matter/issues/942): Fix to typo on welcome screen thanks to [Stephanie Wertman](https://github.com/stephanie-wertman)
- [#957](https://github.com/estruyf/vscode-front-matter/issues/957): Fix media assets retrieval where `mtime` is not defined. Fallback to the `mtimeMs` property if available.
## [10.8.0] - 2025-02-27 - [Release notes](https://beta.frontmatter.codes/updates/v10.8.0)

View File

@@ -172,7 +172,14 @@ export class MediaHelpers {
}
})
);
files = files.filter((f) => f.mtime !== undefined);
files = files
.filter((f) => f.mtime !== undefined || f.mtimeMs !== undefined)
.map((f) => {
if (f.mtime === undefined && f.mtimeMs !== undefined) {
return { ...f, mtime: new Date(f.mtimeMs as number) };
}
return f;
});
// Sort the files
if (crntSort?.type === SortType.string) {

View File

@@ -16,6 +16,7 @@ export interface MediaInfo {
dimensions?: ISizeCalculationResult | undefined;
mimeType?: string | undefined;
mtime?: Date;
mtimeMs?: number;
ctime?: Date;
size?: number;