Replies: 17 comments 25 replies
|
This would be my number one request as well, even if not automatic, being able to push sync progress to KOReader would make this the perfect on the go ereader. |
|
I also want this for being able to use my Kindle as a main reader and swapping back and forth. I may try to bring both features to the firmware in one go if possible. |
|
Wow! Amazing! Thank you!!
- CJ
…On Sat, Jan 3, 2026, 20:56 Justin Mitchell ***@***.***> wrote:
This is done and just pending merge: #232
<#232>
—
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANI2QDRI63KNP3P2BTKTOYT4FCMRTAVCNFSM6AAAAACPQBUWZSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKNBQGMYDQNQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
|
Yeah this is going to be a game changer! Thank you!
- CJ
…On Sun, Jan 4, 2026, 00:09 Justin Mitchell ***@***.***> wrote:
I implemented it in a way where you see "Sync Progress" at the top of the
chapter select in an epub. You can click that, connect to wifi, and choose
to sync TO or FROM koreader. It tells you the progress locally and the
progress on the sync server as well. I think in the future a periodic
"connect to my wifi and sync" thing could happen but for now it's manual
—
Reply to this email directly, view it on GitHub
<#61 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANI2QDSYFINSV66RYBISIXD4FDDCTAVCNFSM6AAAAACPQBUWZSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKNBQGM3DIMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
|
Koreader sync support is working now but it's a little cumbersome to quickly sync progress. Would it be possible to make a shortcut for long pressing the power button to initiate sync progress? |
|
I don't own an X4, but I was looking into KOSync and I took note of issue #581 and other reddit comments complaints about lack of proper syncing beyond chapter level. I referenced in my comment on that issue:
Given that koreader is lua and easily modifiable, I looked at their function here under the 'syncToProgress' method here: function KOSync:syncToProgress(progress)
logger.dbg("KOSync: [Sync] progress to", progress)
if self.ui.document.info.has_pages then
self.ui:handleEvent(Event:new("GotoPage", tonumber(progress)))
else
self.ui:handleEvent(Event:new("GotoXPointer", progress))
end
endThose events link back to some helper functions they have in this file, and if you just simply re-write the 'syncToProgress' function to use "GotoPercent" (or onGotoPercent) instead of the "GotoXPointer" event, it will do so. Only thing is that the percentage variable that is typically something like '0.2484' to represent 24.84% sort of gets overlooked here, because I can only sync to 24.84 if I give it 24.84, as shown here Passing 0.2484 just rounds to 0. There's probably a reason for that in the intermediate operation. Anyways, this is a hacky fix, and it's really only useful for these use-cases (syncing to KO from a non-KO device), so I'm not exactly sure if this could ever fly in the koreader repo, but for xt users it could be a good tradeoff to swap their files (and update the KOSync from xt side to push 0.XXXX * 100 instead of 0.XXXX, because that value is thrown out anyways as far as I know). If you want to try it, you just have to change the contents of '\koreader\plugins\kosync.koplugin\main.lua' and change the syncToProgress function to: function KOSync:syncToProgress(progress, percentage)
logger.dbg("KOSync: [Sync] progress to", progress)
if self.ui.document.info.has_pages then
self.ui:handleEvent(Event:new("GotoPage", tonumber(progress)))
else
--self.ui:handleEvent(Event:new("GotoXPointer", progress))
self.ui:handleEvent(Event:new("GotoPercent", percentage))
end
endand all instances of Let me know what you think @itsthisjustin @daveallie @osteotek |
|
To follow up, I notice that KOReader calculates its progress variable (at least in the book status, I think it's the same in other parts of the code) like this: local read_percentage = self.ui:getCurrentPage() / self.total_pagesMeaning KO essentially pre-calculates how many rendered pages are left. So the method of basing percentage on Crosspoint's side on readBytes/totalBytes wouldn't quite work. Obtaining a roughly equivalent percentage value on Crosspoint's side could maybe be done if the entire book was indexed in advance of syncing, thereby getting the current page and total pages as KOReader calculates it above. This would probably have some error depending on image frequency. When I get access to crosspoint, I will do some experimenting if it isn't already figured out by then |
|
To follow up on this and the impending PR #783 that syncs crosspoint progress by % instead of chapter, you should be able to achieve two way syncing by modifying a single KOReader file on whatever device you choose by navigating to the file at: And changing this function: function KOSync:syncToProgress(progress)
logger.dbg("KOSync: [Sync] progress to", progress)
if self.ui.document.info.has_pages then
self.ui:handleEvent(Event:new("GotoPage", tonumber(progress)))
else
self.ui:handleEvent(Event:new("GotoXPointer", progress))
end
endto function KOSync:syncToProgress(progress, percentage, device_id)
logger.dbg("KOSync: [Sync] progress to", progress)
if self.ui.document.info.has_pages then
self.ui:handleEvent(Event:new("GotoPage", tonumber(progress)))
else
-- special case that executes only if the sync was done by crosspoint
-- all other devices will sync as normal
if device_id == "crosspoint-reader" then
self.ui:handleEvent(Event:new("GotoPercent", percentage))
else
self.ui:handleEvent(Event:new("GotoXPointer", progress))
end
endand all instances of self:syncToProgress(body.progress)to self:syncToProgress(body.progress, body.percentage, body.device_id)It would probably work, though I can't test it at this moment. It is possible it may not need the * 100, in the GotoPercent call, but in my previous testing it wouldn't work unless the percentage was expressed as XX.XX% instead of 0.XXXX. @osteotek @jpirnay, if you feel comfortable, try it out. |
|
Just to update, my reply above works! Here is the actual function necessary: function KOSync:syncToProgress(progress, percentage, device_id)
logger.dbg("KOSync: [Sync] progress to", progress)
if self.ui.document.info.has_pages then
self.ui:handleEvent(Event:new("GotoPage", tonumber(progress)))
else
if device_id == "crosspoint-reader" then
self.ui:handleEvent(Event:new("GotoPercent", percentage * 100))
else
self.ui:handleEvent(Event:new("GotoXPointer", progress))
end
end
end |
|
Hey guys, thanks for the code, I applied it and sync works great now. One small thing: since my Kindle and the xteink x4 have different screen sizes (and therefore a different amount of text per “page”), the synced reading position ends up being about one page off between the two devices. I assume aligning the exact page across both would be significantly more involved. |
Yes. One of two things would need to change for more accurate sync
|
|
PR #1217 is ready for review and even more relevant ready for testing. I teste hither and dither with the X4, a pocket book device running the latest koreader nightly, a kobo device as well a a jailbroken kindle both running koreader 2025-10 |
|
For those who have already integrated this PR in their local forks: I made a couple of updates over the last days as I was reading more books with edge-case-structures - things are looking good to me - the maximum deviation I encountered were two to three pages from your reading position. |
|
Not sure if this is a features people want but I like to have my books synced automatically. For example I have a kobo with koreader, and my x4, and I normally read the x4 in day light (due to not having a light), and my kobo at night. I wanted them to sync without me having to manually remember that I have to push to remove and pull from remove. I added a PR for it that I am testing locally and it is working well. PR #2756 for checking progress and a draft pr uploading progress PR #2760 |
Uh oh!
There was an error while loading. Please reload this page.
As a small ereader with no backlight, many use it as an on the go ereader with a larger backlit ereader for reading at home. Koreader reading progress sync would be a very helpful feature to have the reading progress sync between your at home ereader and your on the go ereader.
There was a bit of discussion on the relative simplicity of how Koreader sync works on another custom firmware post on reddit here:
https://www.reddit.com/r/xteinkereader/comments/1pmo1rz/comment/nu2w25w/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
All reactions