Skip to content

IPC channels ​

Every channel between the renderer and the main process, from the *_CHANNELS constants in src/main/ipc/ and the window.tankobon API in src/preload.ts (whose type is TankobonApi).

ChannelDirectionPreload APIHandlerDescription
achievements:listrenderer → main (invoke)window.tankobon.achievements.listACHIEVEMENT_CHANNELS.list in src/main/ipc/achievements.tsEvery achievement earned so far, with the moment it was earned.
achievements:unlockrenderer → main (invoke)window.tankobon.achievements.unlockACHIEVEMENT_CHANNELS.unlock in src/main/ipc/achievements.tsRecords achievements as earned (the renderer evaluates the rules); ones already earned are left as they are, an unknown id is refused. Resolves with those that are new, which data:changed announces too.
app:check-updaterenderer → main (invoke)window.tankobon.app.checkUpdateAPP_CHANNELS.checkUpdate in src/main/ipc/app.tsAsks GitHub whether a release newer than the running version is published; a network failure comes back as an error result, not a rejection.
app:get-inforenderer → main (invoke)window.tankobon.app.getInfoAPP_CHANNELS.getInfo in src/main/ipc/app.tsVersions of the app, Electron, Chromium, Node.js and V8, and the OS and CPU architecture.
app:get-system-languagesrenderer → main (invoke)window.tankobon.app.getSystemLanguagesAPP_CHANNELS.getSystemLanguages in src/main/ipc/app.tsThe OS's preferred languages (BCP 47 tags, most preferred first), to resolve the system language setting as the main process does.
app:launch-filemain → renderer (push)window.tankobon.app.onLaunchFileAPP_CHANNELS.launchFile in src/main/ipc/app.tsSubscribes to the main process's app:launch-file push, sent when such a comic is waiting (call takeLaunchFile then); returns the unsubscribe function.
app:open-linkrenderer → main (invoke)window.tankobon.app.openLinkAPP_CHANNELS.openLink in src/main/ipc/app.tsOpens one of the project's pages (repository, documentation…) in the default browser.
app:take-launch-filerenderer → main (invoke)window.tankobon.app.takeLaunchFileAPP_CHANNELS.takeLaunchFile in src/main/ipc/app.tsThe token of the comic the operating system asked to open (double click in the file explorer, "Open with…", a second launch with a file), or null; it is handed out once and opens like a comic.pickFile token.
comic:closerenderer → main (invoke)window.tankobon.comic.closeCOMIC_CHANNELS.close in src/main/ipc/comic.tsCloses a comic opened with open, releasing its archive in the main process.
comic:openrenderer → main (invoke)window.tankobon.comic.openCOMIC_CHANNELS.open in src/main/ipc/comic.tsOpens a comic and registers it in the library (or refreshes its entry); resolves with its saved page. ref is a library entry id or a token from pickFile, never a path. A file that can't be opened (moved, deleted, corrupted, unsupported) resolves to an error result with a message in the interface language, rather than rejecting.
comic:pick-filerenderer → main (invoke)window.tankobon.comic.pickFileCOMIC_CHANNELS.pickFile in src/main/ipc/comic.tsOpens a native file picker; resolves to an opaque token for the chosen file (to pass to open), or null if cancelled. The renderer never learns the path. addToLibrary is true for the library's "add a file" (opening the token then always adds the book) and false for the reader's "open a file" (the book is added only if the addOpenedBooksToLibrary setting is on).
comic:read-pagerenderer → main (invoke)window.tankobon.comic.readPageCOMIC_CHANNELS.readPage in src/main/ipc/comic.tsReads one page (0-based) of a comic opened with open, as image bytes.
data:changedmain → renderer (push)window.tankobon.data.onChangedDATA_CHANGE_CHANNELS.changed in src/main/ipc/data-changes.tsSubscribes to the main process's data:changed push, sent after every database write (library, reading lists, settings); returns the unsubscribe function.
data:clear-cacherenderer → main (invoke)window.tankobon.data.clearCacheDATA_CHANNELS.clearCache in src/main/ipc/data.tsDeletes the cover thumbnails kept in the application's cache folder (they are made again on demand); the library, the settings and the covers beside the comics are left untouched. A failure comes back as an error result.
data:clear-libraryrenderer → main (invoke)window.tankobon.data.clearLibraryDATA_CHANNELS.clearLibrary in src/main/ipc/data.tsEmpties the library (entries, credits, people) and deletes every reading list and cover thumbnail; the comic files and the settings are left untouched. A failure comes back as an error result.
data:exportrenderer → main (invoke)window.tankobon.data.exportDATA_CHANNELS.export in src/main/ipc/data.tsOpens a native save dialog and writes a JSON export there; an error (full or read-only disk…) comes back as a result, not a rejection.
data:importrenderer → main (invoke)window.tankobon.data.importDATA_CHANNELS.import in src/main/ipc/data.tsOpens a native file picker and merges the chosen JSON export into the local database.
database:cancel-restorerenderer → main (invoke)window.tankobon.database.cancelRestoreDATABASE_CHANNELS.cancelRestore in src/main/ipc/database.tsCancels a restoration that has not been applied yet.
database:choose-locationrenderer → main (invoke)window.tankobon.database.chooseLocationDATABASE_CHANNELS.chooseLocation in src/main/ipc/database.tsOpens a native directory picker; the new location only takes effect on the next start.
database:create-backuprenderer → main (invoke)window.tankobon.database.createBackupDATABASE_CHANNELS.createBackup in src/main/ipc/database.tsMakes a copy of the database now (and deletes the ones beyond the number to keep).
database:get-locationrenderer → main (invoke)window.tankobon.database.getLocationDATABASE_CHANNELS.getLocation in src/main/ipc/database.tsWhere the database file currently lives.
database:list-backupsrenderer → main (invoke)window.tankobon.database.listBackupsDATABASE_CHANNELS.listBackups in src/main/ipc/database.tsThe copies of the database kept beside it, most recent first, and the one waiting to be restored.
database:relaunchrenderer → main (invoke)window.tankobon.database.relaunchDATABASE_CHANNELS.relaunch in src/main/ipc/database.tsRestarts the app, e.g. to open the database from its new location.
database:reset-locationrenderer → main (invoke)window.tankobon.database.resetLocationDATABASE_CHANNELS.resetLocation in src/main/ipc/database.tsPoints the app back at the default location; takes effect on the next start.
database:restore-backuprenderer → main (invoke)window.tankobon.database.restoreBackupDATABASE_CHANNELS.restoreBackup in src/main/ipc/database.tsSchedules the restoration of a copy (by its name): the database file is overwritten at the next start.
database:set-file-namerenderer → main (invoke)window.tankobon.database.setFileNameDATABASE_CHANNELS.setFileName in src/main/ipc/database.tsNames the database file (.db is added when missing; null goes back to tankobon.db); an invalid name comes back as an error result. Like the folder, it takes effect on the next start and the existing file is not renamed.
library:add-filerenderer → main (invoke)window.tankobon.library.addFileLIBRARY_CHANNELS.addFile in src/main/ipc/library.tsOpens a native file picker, then adds the chosen comic to the library without opening it; an unreadable file resolves to an error result rather than rejecting. The library organization then moves it, or offers to (organization).
library:add-folderrenderer → main (invoke)window.tankobon.library.addFolderLIBRARY_CHANNELS.addFolder in src/main/ipc/library.tsOpens a native directory picker, then adds every comic found under it, recursively. The library organization then moves them, or offers to (organization).
library:analyze-cleanuprenderer → main (invoke)window.tankobon.library.analyzeCleanupLIBRARY_CHANNELS.analyzeCleanup in src/main/ipc/library.tsFirst step of cleaning the books: lists the files that are not images in the CBZ of ids (the whole library when empty), grouped by extension, without touching anything. Progress goes over onScanProgress. The result's token is what applyCleanup() takes.
library:apply-cleanuprenderer → main (invoke)window.tankobon.library.applyCleanupLIBRARY_CHANNELS.applyCleanup in src/main/ipc/library.tsSecond step: rewrites the archives of the analysis token without those files, except the kinds whose extension (.xml, empty for none) is in keptExtensions. The original is replaced only once the new archive has been checked. The token works once.
library:clean-foldersrenderer → main (invoke)window.tankobon.library.cleanFoldersLIBRARY_CHANNELS.cleanFolders in src/main/ipc/library.tsMoves those orphan folders to the .deletedByTankobon folder of the organized folder; progress arrives through onScanProgress. The folders books are added from are never touched.
library:convert-cbrrenderer → main (invoke)window.tankobon.library.convertCbrLIBRARY_CHANNELS.convertCbr in src/main/ipc/library.tsWrites each CBR of the organized folder as a CBZ beside it, points the book at it (progress, rating, tags and lists are kept) and moves the CBR to .deletedByTankobon at the root of the organized folder. Progress goes over onScanProgress.
library:count-convertiblerenderer → main (invoke)window.tankobon.library.countConvertibleLIBRARY_CHANNELS.countConvertible in src/main/ipc/library.tsHow many CBR of the organized folder convertCbr() would convert, and what its .deletedByTankobon folder holds; an error when the organization is off or its folder unreachable.
library:count-orphan-foldersrenderer → main (invoke)window.tankobon.library.countOrphanFoldersLIBRARY_CHANNELS.countOrphanFolders in src/main/ipc/library.tsHow many folders of the organized folder cleanFolders() would move: those holding no book, only .nfo files and cover images; an error when the organization is off or its folder unreachable.
library:count-unorganizedrenderer → main (invoke)window.tankobon.library.countUnorganizedLIBRARY_CHANNELS.countUnorganized in src/main/ipc/library.tsHow many library comics aren't in their place in the organized folder yet; an error result when the organization is off or its folder unreachable.
library:empty-deletedrenderer → main (invoke)window.tankobon.library.emptyDeletedLIBRARY_CHANNELS.emptyDeleted in src/main/ipc/library.tsDeletes for good everything in the .deletedByTankobon folder of the organized folder.
library:image-scan-progressmain → renderer (push)window.tankobon.library.onImageScanProgressLIBRARY_CHANNELS.imageScanProgress in src/main/ipc/library.tsSubscribes to the progress of that background measure; returns the unsubscribe function.
library:image-scan-statusrenderer → main (invoke)window.tankobon.library.imageScanStatusLIBRARY_CHANNELS.imageScanStatus in src/main/ipc/library.tsWhere the background measure of the books' page sizes is now (it runs after an import, a resync or the first opening of a book); resolves with the state a window that loads late missed.
library:listrenderer → main (invoke)window.tankobon.library.listLIBRARY_CHANNELS.list in src/main/ipc/library.tsEvery library entry, most recently opened first.
library:list-foldersrenderer → main (invoke)window.tankobon.library.listFoldersLIBRARY_CHANNELS.listFolders in src/main/ipc/library.tsThe folders added with addFolder, which resync walks again, in the order they were added.
library:list-unlinked-foldersrenderer → main (invoke)window.tankobon.library.listUnlinkedFoldersLIBRARY_CHANNELS.listUnlinkedFolders in src/main/ipc/library.tsThe library folders that have no path on this machine yet (the library was made on another one): their comics are listed but their files can't be found until relinkFolder.
library:organizerenderer → main (invoke)window.tankobon.library.organizeLIBRARY_CHANNELS.organize in src/main/ipc/library.tsMoves into the organized folder the comics an addition offered to move (organization.pending.token of its result), each into its own subfolder; a token works once.
library:organize-allrenderer → main (invoke)window.tankobon.library.organizeAllLIBRARY_CHANNELS.organizeAll in src/main/ipc/library.tsMoves every library comic not in its place yet into the organized folder (its own subfolder each), whenever it was added. Reports through onScanProgress; an error result when the organization is off, its folder unreachable, or a resynchronization or another organization is running.
library:pick-organization-folderrenderer → main (invoke)window.tankobon.library.pickOrganizationFolderLIBRARY_CHANNELS.pickOrganizationFolder in src/main/ipc/library.tsOpens a native directory picker and makes the chosen folder the library organization's folder (the libraryOrganizationFolder setting, which settings.set refuses), also remembered among the folders resync walks.
library:relink-folderrenderer → main (invoke)window.tankobon.library.relinkFolderLIBRARY_CHANNELS.relinkFolder in src/main/ipc/library.tsOpens a native directory picker to say where an unlinked folder (an id returned by listUnlinkedFolders) is on this machine; the comics stored relative to it are found again.
library:removerenderer → main (invoke)window.tankobon.library.removeLIBRARY_CHANNELS.remove in src/main/ipc/library.tsRemoves an entry from the library. The file on disk is left untouched, unless deleteFile is true: it (and its cover and .nfo sidecars) then goes to the trash. An error result means the entry is gone from the library but the file could not be trashed.
library:remove-folderrenderer → main (invoke)window.tankobon.library.removeFolderLIBRARY_CHANNELS.removeFolder in src/main/ipc/library.tsForgets one of those folders (a path returned by listFolders); its comics stay in the library.
library:remove-manyrenderer → main (invoke)window.tankobon.library.removeManyLIBRARY_CHANNELS.removeMany in src/main/ipc/library.tsRemoves several entries from the library; with deleteFiles, their files (and the covers beside them) are also moved to the system trash. A file that can't be trashed is counted as failed, its entry is removed anyway.
library:resyncrenderer → main (invoke)window.tankobon.library.resyncLIBRARY_CHANNELS.resync in src/main/ipc/library.tsWalks the remembered folders (and the organized folder, when the organization is on) again: new comics are added (then moved or offered by the organization, a comic dropped in the organized folder being moved into place), and comics whose file no longer exists are removed from the library (with their progress, rating, tags and reading-list places; the files on disk are never touched). A folder that can't be read is skipped and counted as unreachable. Comics of those folders without a .nfo get one written from their library information (an existing one is never overwritten), counted as nfoWritten, and the missing cover thumbnails of those comics are extracted, counted as coversExtracted. Stores the date as the lastResyncAt setting. Reports through onScanProgress; an error result when one is already running.
library:scan-progressmain → renderer (push)window.tankobon.library.onScanProgressLIBRARY_CHANNELS.scanProgress in src/main/ipc/library.tsSubscribes to the progress of addFolder, resync, organizeAll, convertCbr and cleanFolders; returns the unsubscribe function.
library:set-coverrenderer → main (invoke)window.tankobon.library.setCoverLIBRARY_CHANNELS.setCover in src/main/ipc/library.tsReplaces the cover thumbnail of a library entry with image (PNG, JPEG or WebP, at most 8 MiB, already cropped to the cover's 2:3 proportions by the caller); the main process shrinks it to the thumbnail size and writes it beside the comic (or in the local cache). A picture that can't be decoded comes back as an error result and leaves the current cover as it was.
library:thumbnailrenderer → main (invoke)window.tankobon.library.thumbnailLIBRARY_CHANNELS.thumbnail in src/main/ipc/library.tsCover thumbnail (first page, shrunk) of a library entry as WebP bytes, generated and cached first when missing; null if the entry is unknown or unreadable.
library:update-metadatarenderer → main (invoke)window.tankobon.library.updateMetadataLIBRARY_CHANNELS.updateMetadata in src/main/ipc/library.tsWrites the given metadata fields (title, series, credits…) of a library entry; resolves with the updated entry, or null if it is gone.
library:update-metadata-manyrenderer → main (invoke)window.tankobon.library.updateMetadataManyLIBRARY_CHANNELS.updateMetadataMany in src/main/ipc/library.tsWrites the same metadata fields on several library entries at once (all or none); resolves with the number of entries updated (unknown ids are skipped).
library:update-progressrenderer → main (invoke)window.tankobon.library.updateProgressLIBRARY_CHANNELS.updateProgress in src/main/ipc/library.tsSaves the last page read (0-based) of a library entry.
library:update-ratingrenderer → main (invoke)window.tankobon.library.updateRatingLIBRARY_CHANNELS.updateRating in src/main/ipc/library.tsSets the rating of a library entry: 0 (unrated) to 5.
library:update-tagsrenderer → main (invoke)window.tankobon.library.updateTagsLIBRARY_CHANNELS.updateTags in src/main/ipc/library.tsReplaces the tags of a library entry.
metadata:applyrenderer → main (invoke)window.tankobon.metadata.applyMETADATA_CHANNELS.apply in src/main/ipc/metadata.tsSaves what the user accepted in the lookup dialog: updates the library entry, rewrites the .nfo beside the file and makes the cover thumbnail if it has none, or replaces it with the picture at coverUrl (an address of the sources' cover hosts, else ignored; a picture that can't be downloaded keeps the current cover); resolves with the updated entry, or null if it is gone.
metadata:cancelrenderer → main (invoke)window.tankobon.metadata.cancelMETADATA_CHANNELS.cancel in src/main/ipc/metadata.tsStops the lookup this window is waiting for (search() or fromPage()): its requests are aborted and the call fails. Does nothing when none is under way.
metadata:from-pagerenderer → main (invoke)window.tankobon.metadata.fromPageMETADATA_CHANNELS.fromPage in src/main/ipc/metadata.tsReads a book from the page at url, a link the user pasted (Bédéthèque album, BDfugue product or Nautiljon volume).
metadata:searchrenderer → main (invoke)window.tankobon.metadata.searchMETADATA_CHANNELS.search in src/main/ipc/metadata.tsLooks a book up in the public APIs enabled in the settings (Comic Vine, Google Books), or only in those named by query.sources.
reading-lists:add-entriesrenderer → main (invoke)window.tankobon.readingLists.addEntriesREADING_LIST_CHANNELS.addEntries in src/main/ipc/reading-lists.tsAppends several library entries to a reading list, in the order given: books already in it are skipped, and once it holds 50 books the rest are left out (the result counts each case).
reading-lists:add-entryrenderer → main (invoke)window.tankobon.readingLists.addEntryREADING_LIST_CHANNELS.addEntry in src/main/ipc/reading-lists.tsAppends a library entry to a reading list; refused when the list already holds 50 books.
reading-lists:createrenderer → main (invoke)window.tankobon.readingLists.createREADING_LIST_CHANNELS.create in src/main/ipc/reading-lists.tsCreates an empty reading list; refused when the name is empty.
reading-lists:listrenderer → main (invoke)window.tankobon.readingLists.listREADING_LIST_CHANNELS.list in src/main/ipc/reading-lists.tsEvery reading list, in the user's order (new lists last), each with its library entry ids in reading order.
reading-lists:removerenderer → main (invoke)window.tankobon.readingLists.removeREADING_LIST_CHANNELS.remove in src/main/ipc/reading-lists.tsDeletes a reading list; its books stay in the library.
reading-lists:remove-entryrenderer → main (invoke)window.tankobon.readingLists.removeEntryREADING_LIST_CHANNELS.removeEntry in src/main/ipc/reading-lists.tsTakes a library entry out of a reading list.
reading-lists:renamerenderer → main (invoke)window.tankobon.readingLists.renameREADING_LIST_CHANNELS.rename in src/main/ipc/reading-lists.tsRenames a reading list; refused when the name is empty.
reading-lists:reorderrenderer → main (invoke)window.tankobon.readingLists.reorderREADING_LIST_CHANNELS.reorder in src/main/ipc/reading-lists.tsStores a new order for a reading list; entryIds must hold exactly the list's current entries.
reading-lists:reorder-listsrenderer → main (invoke)window.tankobon.readingLists.reorderListsREADING_LIST_CHANNELS.reorderLists in src/main/ipc/reading-lists.tsStores a new order for the reading lists themselves; listIds must hold exactly the current lists.
settings:get-allrenderer → main (invoke)window.tankobon.settings.getAllSETTINGS_CHANNELS.getAll in src/main/ipc/settings.tsEvery setting except the API keys, with defaults for the ones never stored.
settings:get-api-keysrenderer → main (invoke)window.tankobon.settings.getApiKeysSETTINGS_CHANNELS.getApiKeys in src/main/ipc/settings.tsThe metadata sources' API keys, kept out of getAll() so only the page that edits them loads them.
settings:setrenderer → main (invoke)window.tankobon.settings.setSETTINGS_CHANNELS.set in src/main/ipc/settings.tsStores one setting; the main process refuses an unknown key or a value its validator rejects.
stats:add-reading-timerenderer → main (invoke)window.tankobon.stats.addReadingTimeSTATS_CHANNELS.addReadingTime in src/main/ipc/stats.tsAdds seconds (1 to 3600) of reading time on a library entry to today; the reader reports it every few minutes while a book is open.
stats:clear-historyrenderer → main (invoke)window.tankobon.stats.clearHistorySTATS_CHANNELS.clearHistory in src/main/ipc/stats.tsDeletes the active user's reading history (the time spent per book and day, hence the statistics' reading time too); books, progress and completion dates are kept.
stats:getrenderer → main (invoke)window.tankobon.stats.getSTATS_CHANNELS.get in src/main/ipc/stats.tsThe reading history: the dates at which books were finished and the reading time per day, oldest first.
stats:historyrenderer → main (invoke)window.tankobon.stats.historySTATS_CHANNELS.history in src/main/ipc/stats.tsThe active user's reading history for the profile page: reading time per day and book, most recent first, at most 200 lines.
users:createrenderer → main (invoke)window.tankobon.users.createUSER_CHANNELS.create in src/main/ipc/users.tsAdds a user (nickname trimmed, not empty, unique ignoring case) with the default picture; it doesn't switch to them.
users:listrenderer → main (invoke)window.tankobon.users.listUSER_CHANNELS.list in src/main/ipc/users.tsEvery user and the active one's id.
users:pick-avatarrenderer → main (invoke)window.tankobon.users.pickAvatarUSER_CHANNELS.pickAvatar in src/main/ipc/users.tsOpens a native picker for the active user's picture and returns the picked file's bytes (a PNG, JPEG or WebP), for the renderer to shrink before setAvatar().
users:removerenderer → main (invoke)window.tankobon.users.removeUSER_CHANNELS.remove in src/main/ipc/users.tsDeletes the active user and all their personal data (progress, ratings, tags, lists, statistics, achievements, settings); the library is untouched. Refused for the last remaining user. On success the result is the user the app switched to.
users:remove-avatarrenderer → main (invoke)window.tankobon.users.removeAvatarUSER_CHANNELS.removeAvatar in src/main/ipc/users.tsPuts the active user's default picture back.
users:renamerenderer → main (invoke)window.tankobon.users.renameUSER_CHANNELS.rename in src/main/ipc/users.tsChanges the active user's nickname.
users:set-avatarrenderer → main (invoke)window.tankobon.users.setAvatarUSER_CHANNELS.setAvatar in src/main/ipc/users.tsStores the active user's picture (PNG, JPEG or WebP of at most 256 KiB).
users:switchrenderer → main (invoke)window.tankobon.users.switchUSER_CHANNELS.switch in src/main/ipc/users.tsMakes another user the active one: everything personal, and the interface language, follow. data:changed announces it to every window.