Ensure xklb-metadata.db has live_status and error columns#265
Ensure xklb-metadata.db has live_status and error columns#265deldesir wants to merge 19 commits into
Conversation
Sync with upstream
|
Proposed to work with: Building on: |
|
Co-authored-by: A Holt <holta@users.noreply.github.com>
Co-authored-by: A Holt <holta@users.noreply.github.com>
Co-authored-by: A Holt <holta@users.noreply.github.com>
Co-authored-by: A Holt <holta@users.noreply.github.com>
|
@deldesir indicates that this PR will need to be changed and use iiab-glue.db because of the DB refactoring that will map books and media. |
@deldesir please make the decision as-final-as-it-can-be today. The description on top of this PR is empty, which is definitely not helpful. So I'm pasting in your private comments from October 8 — as this needs to accelerate:
|
@deldesir I may have misunderstood what you were saying Friday morning? From looking at the code changes, I think the check for the columns/additions is independent of book/media mapping. |
|
Makes much more sense! Thank you! |
deldesir
left a comment
There was a problem hiding this comment.
Patching tube_add did not work. No matter what, error column would not be created because it is being removed from entry when its value is None due to a filtering process.
As a result, the insert method doesn't see the error key and doesn't alter the table schema to include it.
With the latest commit, the add function in db_media.py is modified to ensure the error key is included in entry even when its value is None.
entry = {k: v for k, v in entry.items() if v is not None or k == 'error'}
if entry is None:
return
|
|
@deldesir Does this |
Co-authored-by: A Holt <holta@users.noreply.github.com>
Co-authored-by: A Holt <holta@users.noreply.github.com>
|
This PR and its companion iiab/iiab#3827 are on the track to be abandoned. 2 days already, still not working as expected due to the complexity of xklb's db operations. PR #259 is adjusted to achieve the same goal. |
|
ONGOING DEBATE: Are the 4 lines below in PR #259's SQLalchemy approach (in |
This pull request is related to the creation of
xklb-metadata.db. Two key columns:live_statusanderror, are needed to avoid missing columns error. XKLB does not create them upfront, so we take care of this by adding them.There additions are in fact a patch in xklb's
tube_add.pyto ensure we don't have to make Calibre-Web create xklb-metadata.db from scratch using the schema inxb.py. It also ensures we have key columns ready while leveragin xklb's handling of the database.