Repository navigation
Conversation
… mode generate_book_checksums() opened os.path.join(self.library_dir, "metadata.db"), but in split-library mode library_dir is switched to the book-files folder. sqlite3 then created an empty metadata.db there and every import logged "no such table: books", so no KOReader checksum was stored. Use self.metadata_db, which is set before the switch. Book file paths keep using library_dir. The fix and test follow PR crocodilestick#1474. Fixes crocodilestick#1513 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1513.
With split library on, every import logs "no such table: books" and leaves an empty metadata.db in the books folder, so no KOReader checksum is stored for new books.
generate_book_checksumsopensmetadata.dbunderself.library_dir, but in split-library modelibrary_dirhas already been switched to the books folder.The fix uses
self.metadata_db, which is set before that switch. Book file paths keep usinglibrary_dir, since that is where the files are.This is the checksum part of #1474, split out so it can merge on its own; that PR conflicts with main and also changes other files. The fix and the test follow it. Two changes against current main: the KOReader sync check added above this line stays, and the test turns that setting on, otherwise the function returns before the checksum code runs.
How I tested it:
pytest -m "smoke or unit"as in the tests workflow, on Python 3.13: 273 passed, 26 skipped.ingest_processor.pymounted in: no error, no metadata.db in the books folder, and the checksum is stored.I used Claude (AI assistant) to help write this change; I reviewed it before opening.