Skip to content

Import total pages from calibre on sync#407

Open
ShaidarHaran93 wants to merge 1 commit intomasonfox:developfrom
ShaidarHaran93:develop
Open

Import total pages from calibre on sync#407
ShaidarHaran93 wants to merge 1 commit intomasonfox:developfrom
ShaidarHaran93:develop

Conversation

@ShaidarHaran93
Copy link
Copy Markdown

Hi, I found out about this project yesterday. I have been setting it up today and trying to migrate my data from Excel (12+ years of readings)

One of the pain points I found is that for each book I had to add the total pages number manually which was quite the chore because I had to go to Calibre to look for it.
I had been estimating the pages for years with the Count Pages plugin but while investigating how to add this feature, I found out Calibre added a new table books_pages_link last December which contains the data (you have to add the column on the calibre list view so it does create and populate the new table).

What this PR does

  • Adds a total_pages field to CalibreBook interface.
  • On each of the queries that return that interface.
    • Checks that the table exists.
    • Pulls the page number into the new field.
  • On the syncCalibreLibrary function, when mapping the NewBook object, it maps totalPages from the calibreBook if it exists.

⚠️It does overwrite any value changed manually every time it syncs from Calibre, but if I understood correctly, Calibre's DB is the source of truth so this is not an issue.

I ran the tests and also did a quick check with a copy of my library.

@masonfox
Copy link
Copy Markdown
Owner

masonfox commented Mar 29, 2026

@ShaidarHaran93, thanks for opening this PR! I apologize for the delay, but will take a look at this soon! Cheers!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants