forked from iarv/vscode-front-matter
Issue: Check why media files are not loading in the latest version #957
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface MediaInfo {
|
||||
dimensions?: ISizeCalculationResult | undefined;
|
||||
mimeType?: string | undefined;
|
||||
mtime?: Date;
|
||||
mtimeMs?: number;
|
||||
ctime?: Date;
|
||||
size?: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user