Module migrations

Module migrations 

Source
Expand description

Runtime migrations for the library subsystem.

Each migration is registered automatically at startup via the crate::migration! macro and tracked in the _cadmus_migrations table.

ยงRegistered migrations

ModuleMigration ID
import_legacy_filesystem_data::MIGRATION_IDv1_import_legacy_filesystem_data

Modulesยง

import_legacy_filesystem_data
Module generated by the crate::migration! macro.

Functionsยง

delete_thumbnail_previews ๐Ÿ”’
Removes .thumbnail-previews/ from the library directory.
ensure_library ๐Ÿ”’
Ensures the library row exists and returns its id.
ensure_stub_book ๐Ÿ”’
Inserts a stub books row and a library_books association for fp if they do not already exist.
import_legacy_filesystem_data ๐Ÿ”’
Imports book metadata from .metadata.json and reading progress from .reading-states/<fingerprint>.json into SQLite for every library path listed in Settings.toml. Covers both legacy library modes:
import_library ๐Ÿ”’
Imports all books and reading states from a single library directory.
import_metadata_entries ๐Ÿ”’
Imports all entries from a .metadata.json file into the database.
import_orphan_reading_states ๐Ÿ”’
Imports reading states from .reading-states/ that are not in already_imported.
insert_book ๐Ÿ”’
insert_reading_state ๐Ÿ”’
load_metadata ๐Ÿ”’
mark_library_imported ๐Ÿ”’
Renames .metadata.json and .reading-states/ to their .imported suffixed equivalents so that subsequent runs of the migration skip this library.