Open deldesir opened 1 month ago
Proposed to work with:
Building on:
@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 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:
PR #191 from June 18 is not enough — here are the reasons according to @deldesir on October 8:
- To rely on xklb for creating the db instead of doing it ourselves. This make all the triggers, indexes and FTS mechanisms stay intact
- To support CI/CD
- To cover more use cases like galleries, filesystems handling, videos playback tracking…
- Above is for patching xklb in general. For PR #191, I would add:
- Avoid altering the schema ourselves via Calibre-Web because it's xklb's job.”
@deldesir please make the decision as-final-as-it-can-be today.
In other words:
@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 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.
@avni I meant PR #255, sorry for the misunderstanding.
Makes much more sense! Thank you!
error column would not be created
Can this PR #265's title (subject line) be clarified a bit, explaining the new approach?
Adjust the Description on top of this PR, if it top needs revising?
Are live_status
and error
columns still specifically being added by this PR's helper logic? (How does that work, now that this this PR's code has removed the prior tube_add.py
mentions of live_status
and error
?)
@deldesir Does this find
usage example help?
root@box:~# find /root/.local/ -type f -path '*/site-packages/xklb/mediadb/db_media.py'
/root/.local/share/pipx/venvs/xklb/lib/python3.12/site-packages/xklb/mediadb/db_media.py
This PR and its companion https://github.com/iiab/iiab/pull/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 cps/xb.py
) potentially a complete/safe alternative to this PR #265 ?
if not os.path.exists(XKLB_DB_FILE):
print(f"Database file not found at {XKLB_DB_FILE}, creating a new blank database.")
Base.metadata.create_all(self.engine)
print("New blank database created.")
This pull request is related to the creation of
xklb-metadata.db
. Two key columns:live_status
anderror
, 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.py
to 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.