Adds KOReader Sync support#232
Conversation
|
In order to allow my time to be split between all the PRs/work on CrossPoint, I'll be reviewing #219 and getting it merged before coming back to review this one. |
|
Would it be possible to specify a custom server instead of using a default one? For instance, I host a custom server on my NAS in a Docker and would like to use it: https://github.com/koreader/koreader-sync-server. |
|
Yes but I felt this was easier to validate to start. Do custom servers use the exact same system as the official one? |
|
Yes, the protocol is the same, only the URL would be different. |
|
Ok sure I'll add it tonight |
This is done and tested with https://sync.send2ereader.net. I also implemented file name matching because until the calibre wireless device stuff I did is merged I can't seem to get the hashes to match. I tested pushing and pulling and it works great. |
Resolves conflict in SettingsActivity.cpp: - Adopts new SettingInfo factory pattern from master - Includes new settings: Sleep Screen Cover Mode, Reader Screen Margin - Preserves KOReader Sync action from feature branch
|
I wanted to test this feature because it is something I also want in crosspoint, thank you for implementing. I am not sure I have the time and the technical know how to help out but I tried testing it: I have built and flashed the pr branch and added https://sync.send2ereader.net on both my PocketBook and xteink4 onto the same account with only one .epub book with the same filename. However I push or pull progress it never matches up between the devices. The TOC has multiple books in it as it is the complete Witcher series.
Case 2.
I tried to be concise, but might have failed and I can send you the epub to test with or I might have messed something up. I think this probably has to do with how the TOC and progress is being handled. |
|
Yes please send me the book. I am not sure if there's a unique setup with that book having multiple books inside it? Have you tried just using KoReader on two devices without crosspoint involved and seeing if it syncs fine? The way crosspoint handles progress is a bit different than koreader so I did % based mapping to the chapter. You can upload the file here for me: https://files.sofriendly.com/i/2Xwdh4F/itsthisjustin |
|
Uploaded. I will try installing Koreader on my phone as I only have the Pocketbook and Xteink. |
Ha well now that alt sync server appears to be down so I can't test anymore |
|
With android and pocketbook koreader no matter what I do, it seems to think the latest progress was from the device Im trying to sync from. Hopefully this isn't an error message for the backup service being down. Sigh. |
|
Nevermind figured out what I messed up, it works with Koreader on android and Koreader on pocketbook as expected. |
Ok I'll take a look. |
|
Given #219 is now merged, I'm keen to dive into this one over the next day or so, I assume it's still ready for a look @itsthisjustin? |
Code quality wise yes. I still plan to see if there's some special case needed for compendium style books like the entire witcher series. This sync works for my simple 15 page epub I've been testing with though |
|
Sorry for the delay in getting to this, I plan to look at it on Wednesday. |
|
So @daveallie due to the way the epub parser works compared to how KOReader works, we'd have to have character level tracking in the epub to get EXACT sync. What I've done for now is basically chapter level sync unless you want to go down the rabbit hole of trying to do a deeper level conversion which could be insanely processor intensive. Chapter sync is at least super helpful for a book this large which doesn't even contain a TOC on a per book basis making it insanely hard to manually navigate this (i.e. the sync feature here is still super useful even if it's not granularly syncing down the sentence) |
I think it makes sense but it would require the same level of calculation I believe? |
|
Yes, but might be able to save time by not calculating the progress when uploading from crosspoint if the device running KOReader is going to calculate it itself once it locates the xpath, so maybe the toKOReader() function of progressmapper isn’t necessarily needed and can be dummy’d in the upload packet. |
So I like it there because we can compare the progress to see which copy is further ahead. Helpful for determining oh yeah I was way further along on this device, I want to pull that progress. Hopefully I'm understanding what you're saying |
* origin: fix: truncate chapter names that are too long (crosspoint-reader#422) feat: dict based Hyphenation (crosspoint-reader#305) fix: render U+FFFD replacement character instead of ? (crosspoint-reader#366) fix: Invert colors on home screen cover overlay when recent book is selected (crosspoint-reader#390) Adds KOReader Sync support (crosspoint-reader#232) feat: Change keyboard "caps" to "shift" & Wrap Keyboard (crosspoint-reader#377) fix: XTC 1-bit thumb BMP polarity inversion (crosspoint-reader#373)
|
Hey Justin - just trying to set this up. First time using KOreader on my Kobo. Do you recommend using file name matching or hash matching? You mention MD5 hashing in the PR description. I don't have either with me right now and I'm killing time so apologies for not trying myself. I'm super excited to get this going though so thanks for your hard work on this. |
|
I personally use file name as it was way easier to transfer the files over USB prior to calibre wireless device syncing working |
1 similar comment
|
I personally use file name as it was way easier to transfer the files over USB prior to calibre wireless device syncing working |
|
Got this working now with the Calibre Library feature you added too! |
## Summary - Adds KOReader progress sync integration, allowing CrossPoint to sync reading positions with other KOReader-compatible devices - Stores credentials securely with XOR obfuscation - Uses KOReader's partial MD5 document hashing for cross-device book matching - Syncs position via percentage with estimated XPath for compatibility # Features - Settings: KOReader Username, Password, and Authenticate options - Sync from chapters menu: "Sync Progress" option appears when credentials are configured - Bidirectional sync: Can apply remote progress or upload local progress --------- Co-authored-by: Dave Allie <[email protected]>
## Summary Addresses #504 - Reverts book progress % to showing as an integer instead of with a decimal place - This was changed to 1 decimal point of precision in #232 from what I can tell - As this wasn't the primary intention of that PR, I'm assuming it was left in accidentally IMO having a decimal place of precision is too much for something as vague as book completion percent. This de-clutters the status bar and prevents extra updates as you change pages. --- ### AI Usage YES
|
I'm a little bit confused. With this merge, it doesn't behave 1:1 like the official koreader sync right? Since crosspoint koreader sync only syncs the chapter that you're currently in and not where you're actually in the chapter. What happens if my epub doesnt have chapters? |
So it uses a combination of the % estimate and page number to try to find the closest spot. If an epub has no concept of chapters I think it will just estimate percentage and land somewhere close vs rounding down to start of chapter |
1 similar comment
So it uses a combination of the % estimate and page number to try to find the closest spot. If an epub has no concept of chapters I think it will just estimate percentage and land somewhere close vs rounding down to start of chapter |
## Summary Addresses crosspoint-reader#504 - Reverts book progress % to showing as an integer instead of with a decimal place - This was changed to 1 decimal point of precision in crosspoint-reader#232 from what I can tell - As this wasn't the primary intention of that PR, I'm assuming it was left in accidentally IMO having a decimal place of precision is too much for something as vague as book completion percent. This de-clutters the status bar and prevents extra updates as you change pages. --- ### AI Usage YES
|
@itsthisjustin / @bartiprime I have exactly the same question/issue. I'm only getting synced to beginning of the chapter which is not useful when the book I'm reading has big chapters. Any idea what is going wrong? |
|
@Jelle-elaut would it be possible to test if this PR solves kosync issues? #783 |
## Summary - Adds KOReader progress sync integration, allowing CrossPoint to sync reading positions with other KOReader-compatible devices - Stores credentials securely with XOR obfuscation - Uses KOReader's partial MD5 document hashing for cross-device book matching - Syncs position via percentage with estimated XPath for compatibility # Features - Settings: KOReader Username, Password, and Authenticate options - Sync from chapters menu: "Sync Progress" option appears when credentials are configured - Bidirectional sync: Can apply remote progress or upload local progress --------- Co-authored-by: Dave Allie <[email protected]>
## Summary Addresses crosspoint-reader#504 - Reverts book progress % to showing as an integer instead of with a decimal place - This was changed to 1 decimal point of precision in crosspoint-reader#232 from what I can tell - As this wasn't the primary intention of that PR, I'm assuming it was left in accidentally IMO having a decimal place of precision is too much for something as vague as book completion percent. This de-clutters the status bar and prevents extra updates as you change pages. --- ### AI Usage YES
Summary
KOReader-compatible devices
Features