hadynz / obsidian-kindle-plugin

Sync your Kindle notes and highlights directly into your Obsidian vault
MIT License
897 stars 52 forks source link

Added Sync via exported HTML file #230

Closed ceselder closed 1 year ago

ceselder commented 1 year ago

I made this change since this is the only way you can sync notes that are taken cross-platform on books sent via send to kindle.

Amazon sync does not support highlights of books sent via send to kindle and my clippings will not store notes taken on a mobile device.

This enables people to save notes from books with overdrive/libby or otherwise any epub the person already owned.

It is fully working, except for when you try to sync books that track the location of the quote via page instead of Location.

This is the case for amazon purchased books only. In this case the Location of the note/highlight will fail, since these exported notes only support tracking via pages, not both via pages and location like I suspect the API can.

I am not familiar enough with the code base to fix this and I'm short on time due to exams. I dont personally need this fixed since I see no reason someone would sync via this method if the book wasnt a book sent via send to kindle. But I ofcourse understand that you would not want to merge this before it is fixed. I'll have a look at it someday if none of you will. There might be other issues/bugs that I missed since I didnt test my implementation that extensively.

Attached is how the UI now looks and the second image is the issue I outlined.

image image

ceselder commented 1 year ago

Actually come to think of it, this might be a good solution for people that dont want to risk the security issues with logging in via amazon, so making this work on amazon bought books is probably worthwhile.

hadynz commented 1 year ago

Thank you so much for making this change @ceselder. It is a feature that many people have asked for.

We will probably need to rethink the user interface now that there are more than two methods of importing highlights. But that can be done as another separate piece.

The key ask that I would want to see to get closer to merging this change is writing unit tests for the parser that you've made. I expect there to be many scenarios that we would not have accounted for that other users will raise. It helps if we have a foundation of tests to add to from the get go.

ceselder commented 1 year ago

This is akward but I kinda got a kobo now. Sorry but will not continue delvelopment on this

hadynz commented 1 year ago

Congrats on the Kobo! That would be quite a significant shift of ecosystem.

I'll close this PR and will use it as inspiration when I pickup this enhancement in the future.

jgodoy commented 9 months ago

Any idea if this can be done in the near future? I've got a Kindle Paperwhite that is not accessible via USB anymore so now I only have the Android share as HTML for Send to Kindle/Shared with Kindle books...

gtianyi commented 6 months ago

Do we have plan to resume work on this PR please? It would be very useful for folks like me who have highlights on both Kindle app and Kindle, which can only export a HTML via email. Looks like we are very close to merge?