Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPUB: add identifiers to doc props #560

Merged
merged 4 commits into from Apr 6, 2024

Conversation

baswag
Copy link
Contributor

@baswag baswag commented Apr 3, 2024

I wanted to write a plugin to automatically sync my progress from KOReader to hardcover.app and need the ISBN of the book for that to ensure proper matching.

This will add the identifiers as doc_prop in the format of scheme:identifier separated by ; e.g. isbn:9783462312317;asin:b0ckwvvv4z


This change is Reviewable

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems okay to me

crengine/src/epubfmt.cpp Outdated Show resolved Hide resolved
@Frenzie Frenzie requested a review from poire-z April 3, 2024 17:18
crengine/include/lvdocview.h Outdated Show resolved Hide resolved
crengine/include/lvtinydom.h Outdated Show resolved Hide resolved
crengine/src/epubfmt.cpp Outdated Show resolved Hide resolved
crengine/src/epubfmt.cpp Outdated Show resolved Hide resolved
change separator from ; to \n
lvtinydom.h: move DOC_PROP_IDENTIFIERS below DOC_PROP_KEYWORDS
epubfmt.cpp: fix styling of if/else
Comment on lines 1398 to 1400
lString32 identifier;

// In version 3, scheme is not set but the type is rather included in the text itself
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(You could remove this blank line, that doesn't really need to separate these 2 blocks.)

I'll merge it soon, and will bump it into koreader frontend with other fixes in the coming days.
Do you need/have some buddy changes to koreder-base/cre.cpp and/or frontend that should accompany this? Or is it all that is needed for your plugin ?

(Logically, for this to affect already opened book with a cache, we'd need to bump some version so all books are reparsed and get this new metadata in the cache. But if you're the only user of that for the coming days, no need to bump it and bother other users with a reload - so only you will need to rm cr3cache/* to get your books reparsed.)
(Unless I need to myself bump that version because of other changes, not sure yet if I'll have to.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

None yet

3 participants