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

Fix sort-by-last-read when partition is mounted noatime #3990

Merged
merged 2 commits into from May 30, 2018

Conversation

Projects
None yet
2 participants
@alethiophile
Contributor

alethiophile commented May 30, 2018

Fixes #3988. This just manually updates the atime when an ebook is read (in the history logging code) rather than relying on the kernel. I think this is better than reworking the last-read comparison code to reference the history data automatically; that would be a much larger change, and the history list is trimmed anyway.

This uses the existing luafilesystem touch() call, which calls utime(). Thus, it explicitly reads and preserves the file mtime so that the "by modification" sort view won't be messed up. Philosophically, it would be preferable to call something in the utimensat() family and pass UTIME_OMIT, but the busybox /bin/touch available on the Kobo doesn't expose the -a option that would make that easy, and in practice one-second granularity is sufficient for this case.

alethiophile and others added some commits May 30, 2018

@Frenzie

This comment has been minimized.

Member

Frenzie commented May 30, 2018

Thanks! I reworded the comment slightly because it was Kobo-specific. :-)

@Frenzie Frenzie merged commit 4c8ef61 into koreader:master May 30, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment