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

feat: epub progress tracking #121

Merged
merged 8 commits into from
Apr 22, 2023
Merged

feat: epub progress tracking #121

merged 8 commits into from
Apr 22, 2023

Conversation

aaronleopold
Copy link
Collaborator

Stump now has minimal abilities for tracking the progress of EPUB reading, granted it is a bit scuffed. epubjs has not made this very easy... I extract the current epubcfi as a user reads, so that the next session properly navigates to the appropriate point in the book, and then I have a percentage approximation. Both of these operations are calculated in this rather gross effect. There was no (functional) means for me to calculate the percentage from the epubcfi using epubjs, and so I came up with the following:

(current chapter / chapter count) + ((page in chapter / pages in chapter) * (1 / chapter count))

The obvious issue is not all chapters are of the same size, but since I have no other means of extracting this information from epubjs, this will have to do for now. FWIW, I tested about 10 books and I never was more than 1.5% off at the end of the book (i.e. 98.5% instead of the true 100%).

I also cleaned up a couple of the OPDS endpoints, and added the download OPDS endpoint for media files.

@aaronleopold aaronleopold changed the title [WIP] feat: epub progress tracking feat: epub progress tracking Apr 22, 2023
@aaronleopold aaronleopold marked this pull request as ready for review April 22, 2023 00:51
@aaronleopold aaronleopold merged commit 8960e4f into develop Apr 22, 2023
@aaronleopold aaronleopold deleted the al/epub-progress branch April 22, 2023 17:33
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.

1 participant