File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Internal } from '@opd-libs/opd-metadata-lib/lib/Internal';
55import { arrayEquals , traverseObjectToParentByPath } from './utils/Utils' ;
66import { traverseObjectByPath } from '@opd-libs/opd-utils-lib/lib/ObjectTraversalUtils' ;
77import getMetaDataFromFileContent = Internal . getMetaDataFromFileContent ;
8+ import getMetadataFromFileCache = Internal . getMetadataFromFileCache ;
89
910export interface MetadataFileCache {
1011 file : TFile ;
@@ -44,17 +45,12 @@ export class MetadataManager {
4445 console . debug ( `meta-bind | MetadataManager >> registered ${ uuid } to newly created file cache ${ file . path } -> ${ metadataPath } ` ) ;
4546 const c : MetadataFileCache = {
4647 file : file ,
47- metadata : { } ,
48+ metadata : getMetadataFromFileCache ( file , this . plugin ) ,
4849 listeners : [ { onCacheUpdate, metadataPath, uuid } ] ,
4950 cyclesSinceLastUpdate : 0 ,
5051 changed : false ,
5152 } ;
52-
53- this . plugin . app . vault . cachedRead ( file ) . then ( value => {
54- c . metadata = getMetaDataFromFileContent ( value ) ?? { } ;
55- console . log ( `meta-bind | MetadataManager >> loaded metadata for file ${ file . path } ` , c . metadata ) ;
56- this . notifyListeners ( c ) ;
57- } ) ;
53+ console . log ( `meta-bind | MetadataManager >> loaded metadata for file ${ file . path } ` , c . metadata ) ;
5854
5955 this . cache . push ( c ) ;
6056 return c ;
You can’t perform that action at this time.
0 commit comments