Skip to content

Tankōbon / main/db/library-folder-repository / LibraryFolderRepository

Class: LibraryFolderRepository ​

Defined in: main/db/library-folder-repository.ts:28

The folders added to the library with "Ajouter un dossier…", which a resynchronization walks again, and the roots the books' paths are stored relative to (see PathRoots). The database holds each folder's id and the path it had when added; where it is on this machine lives in roots. Kept in the main process only: the renderer never names a path, it only lists them.

Constructors ​

Constructor ​

new LibraryFolderRepository(db, roots?): LibraryFolderRepository

Defined in: main/db/library-folder-repository.ts:29

Parameters ​

db ​

DatabaseSync

roots? ​

PathRoots = ...

Returns ​

LibraryFolderRepository

Methods ​

add() ​

add(folderPath): void

Defined in: main/db/library-folder-repository.ts:87

Remembers a folder and watches it; one that is already known is only watched again.

Parameters ​

folderPath ​

string

Returns ​

void


list() ​

list(): string[]

Defined in: main/db/library-folder-repository.ts:62

The folders a resynchronization walks, in the order they were added, as paths on this machine.

Returns ​

string[]


relink(id, folderPath): boolean

Defined in: main/db/library-folder-repository.ts:80

Says where an unlinked folder is on this machine. False when id is not a known folder.

Parameters ​

id ​

string

folderPath ​

string

Returns ​

boolean


remove() ​

remove(folderPath): void

Defined in: main/db/library-folder-repository.ts:110

Stops watching a folder. Its comics stay in the library, and the folder itself is kept (unwatched) since their stored paths are relative to it.

Parameters ​

folderPath ​

string

Returns ​

void


syncRoots() ​

syncRoots(): boolean

Defined in: main/db/library-folder-repository.ts:45

Finds, at start-up, the folders this machine has no path for yet but whose recorded path exists here (the first run after the roots appeared, or a second machine with the same layout). Returns true when one was found.

Returns ​

boolean


unlinked() ​

unlinked(): UnlinkedFolder[]

Defined in: main/db/library-folder-repository.ts:75

The folders (watched or forgotten) that books refer to and that have no path on this machine.

Returns ​

UnlinkedFolder[]