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
| Module | Migration ID |
|---|---|
import_legacy_filesystem_data::MIGRATION_ID | v1_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
booksrow and alibrary_booksassociation forfpif they do not already exist. - import_
legacy_ ๐filesystem_ data - Imports book metadata from
.metadata.jsonand reading progress from.reading-states/<fingerprint>.jsoninto SQLite for every library path listed inSettings.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.jsonfile into the database. - import_
orphan_ ๐reading_ states - Imports reading states from
.reading-states/that are not inalready_imported. - insert_
book ๐ - insert_
reading_ ๐state - load_
metadata ๐ - mark_
library_ ๐imported - Renames
.metadata.jsonand.reading-states/to their.importedsuffixed equivalents so that subsequent runs of the migration skip this library.