Skip to content

Comments

Modeling iiab-glue.db to enable mapping of books.id (metadata.db) and media.id (xklb-metadata.db)#263

Open
deldesir wants to merge 8 commits intoiiab:masterfrom
deldesir:deldesir-patch-31
Open

Modeling iiab-glue.db to enable mapping of books.id (metadata.db) and media.id (xklb-metadata.db)#263
deldesir wants to merge 8 commits intoiiab:masterfrom
deldesir:deldesir-patch-31

Conversation

@deldesir
Copy link
Collaborator

@deldesir deldesir commented Oct 4, 2024

This pull request introduces the glue_db.py module to model the iiab-glue.db database, facilitating the mapping between books.id in metadata.db and media.id in xklb-metadata.db.

Key Changes:

  • New Module glue_db.py: Implements the GlueDB class and MediaBooksMapping schema to handle database creation, session management, and the mapping between media_id and book_id.

    • Database Initialization: Constructs and initializes the iiab-glue.db file if it does not exist.
    • Session Management: Manages database sessions using SQLAlchemy, ensuring efficient and thread-safe interactions.
  • Tested on Ubuntu 24.04

@deldesir deldesir self-assigned this Oct 4, 2024
@deldesir deldesir marked this pull request as draft October 4, 2024 16:23
@holta holta added the enhancement New feature or request label Oct 4, 2024
@deldesir deldesir requested a review from holta October 14, 2024 20:50
@deldesir deldesir marked this pull request as ready for review October 14, 2024 20:50
@deldesir
Copy link
Collaborator Author

deldesir commented Oct 17, 2024

How to test

To further test, note the number in the URL for the video played from within Calibre-Web (i.e for http://<IIAB_URL>/books/read/31/mp4, the video ID is 31), note also the title of the video and note the media ID associated with it in iiab-glue.db. This media ID can be verified inspecting xklb-metadata.db for its correctness. To do so datasette to review the extraction with datasette /library/calibre-web/xklb-metadata.db -h 0.0.0.0 -p <PORT_NUMBER>. Look for the ID row in media table and compare the title from the actual video with the record under media.title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants