Tankōbon / main/services/library-sync / resyncLibrary
Function: resyncLibrary()
resyncLibrary(
repo,folders,onProgress,inspect):Promise<ResyncSummary>
Defined in: main/services/library-sync.ts:66
Walks every folder again: new comics are added (as a folder scan does), then the entries under that folder whose file no longer exists are removed, with their credits and reading-list places. Safety rules, because a removal loses the user's progress, rating and tags: a folder that can't be read as a directory is skipped entirely (an unplugged drive must not empty the library), and an entry goes only when stat says the file is gone (ENOENT), not merely absent from the walk, which skips the subfolders it can't read. Entries outside every folder (a file added on its own) are checked one by one afterwards: they go when their file is gone and the directory that held it is still readable, so a vanished drive or folder keeps them. The files on disk are never touched.
Parameters
repo
folders
string[]
onProgress
(progress) => void
inspect
(filePath) => Promise<ArchiveSummary>
Returns
Promise<ResyncSummary>