MCPcopy Create free account
hub / github.com/CatMuse/HiNote / getAllHighlightFiles

Method getAllHighlightFiles

src/storage/HiNoteDataManager.ts:178–202  ·  view source on GitHub ↗

* 获取所有高亮文件列表

()

Source from the content-addressed store, hash-verified

176 * 获取所有高亮文件列表
177 */
178 async getAllHighlightFiles(): Promise<string[]> {
179 // 首先从文件映射获取
180 const mappedFiles = this.fileMappingStore.getMappedFiles();
181
182 // 如果映射为空,尝试扫描高亮目录
183 if (mappedFiles.length === 0) {
184 const detectedFiles = await detectHighlightFilesFromStorage(
185 this.app,
186 this.vaultPath,
187 (originalPath, baseName) => {
188 this.fileMappingStore.set(originalPath, baseName);
189 }
190 );
191
192 if (detectedFiles.length > 0) {
193 this.saveFileMapping().catch(err =>
194 console.warn('保存文件映射失败:', err)
195 );
196 }
197
198 return detectedFiles;
199 }
200
201 return mappedFiles;
202 }
203
204
205 /**

Callers

nothing calls this directly

Calls 4

saveFileMappingMethod · 0.95
getMappedFilesMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected