MCPcopy
hub / github.com/ollm/OpenComic / findReadingProgressPaths

Function findReadingProgressPaths

scripts/reading/progress.js:266–300  ·  view source on GitHub ↗
(path, all = false)

Source from the content-addressed store, hash-verified

264}
265
266async function findReadingProgressPaths(path, all = false)
267{
268 if(!all)
269 {
270 const regex = new RegExp('^\s*'+pregQuote(path)+'(?:[\\\/\\\\]|$)');
271 const readingProgress = relative.get('readingProgress');
272
273 let paths = Object.keys(readingProgress).filter(function(key){
274
275 return regex.test(key);
276
277 });
278
279 if(paths.length > 1)
280 {
281 // Remove parent key
282 paths = paths.filter(function(key){
283
284 return path !== key;
285
286 });
287 }
288
289 return paths;
290 }
291 else
292 {
293 const file = fileManager.file(path);
294 file.updateConfig({sort: false});
295 const paths = await _findReadingProgressPaths(path, file);
296 file.destroy();
297
298 return paths;
299 }
300}
301
302async function read(path)
303{

Callers 4

someReadFunction · 0.85
readPagesFunction · 0.85
readFunction · 0.85
unreadFunction · 0.85

Calls 2

pregQuoteFunction · 0.85

Tested by

no test coverage detected