ensure_stub_book

Function ensure_stub_book 

Source
async fn ensure_stub_book(
    tx: &mut Transaction<'_, Sqlite>,
    library_id: i64,
    fp: Fp,
) -> Result<(), Error>
Expand description

Inserts a stub books row and a library_books association for fp if they do not already exist.

The stub has empty strings and zero for the file fields. A follow-up migration is responsible for pruning stub rows whose files are no longer present on disk. Library::import() will fill in the real values for files that are still present.