obsidian-koreader-sync icon indicating copy to clipboard operation
obsidian-koreader-sync copied to clipboard

Bug while trying to use the plugin

Open clemrdh opened this issue 2 years ago • 6 comments

Just trying to use the plugin (0.6.1) in win10, with koReader (last version) on D:\ and the Obsidian storage on H:\ .

plugin:obsidian-koreader-plugin:12787 Uncaught (in promise) TypeError: Cannot read property '0' of null at KOReader.eval (plugin:obsidian-koreader-plugin:12787) at Generator.next () at eval (plugin:obsidian-koreader-plugin:63) at new Promise () at __async (plugin:obsidian-koreader-plugin:47) at KOReader.createNote (plugin:obsidian-koreader-plugin:12785) at KOReader.eval (plugin:obsidian-koreader-plugin:12925) at Generator.next () at fulfilled (plugin:obsidian-koreader-plugin:50)

-> Apparently caused by const page = bookmark.text ? parseInt(bookmark.text.match(/\d+/g)[0]) : -1; -> text.match() is null, so [0] is incorrect.

I don't know if this is due to unaccepted characters in the Book title or other bugs ?

Uncaught (in promise) Error: ENOENT: no such file or directory, mkdir 'H:\Nextcloud\ ...-Christian Arnsperger Dominique Bourg'

Uncaught (in promise) Error: ENOENT: no such file or directory, open 'H:\Nextcloud\DOCUMENTS\NOTES\OBSIDIAN\04-Other\KoReader_HIghlights(book) Ecologie intégrale_ Pour ...-Christian Arnsperger Dominique Bourg\on constate que la méthod... - Christian Arnsperger Dominique Bourg.md'

Uncaught (in promise) Error: ENOENT: no such file or directory, open 'H:\Nextcloud\DOCUMENTS\NOTES\OBSIDIAN\04-Other\KoReader_HIghlights(book) Ecologie intégrale_ Pour ...-Christian Arnsperger Dominique Bourg\favoriserait une intensif... - Christian Arnsperger Dominique Bourg.md'

clemrdh avatar Jun 15 '22 18:06 clemrdh

+1 had same issue, temporarily fixed it by removing highlights where I had a note added.

Seems Koreader data is different in this case which leads to parsing failure and the uncaught exception.

Steps to reproduce: add a highlight in koreader, then tap the highlight and add a note, try to sync again

image

mthlvt avatar Aug 06 '22 07:08 mthlvt

Pitty, have forked and update the plugin : https://github.com/clemrdh/obsidian-koreader-sync/

Now it works with page numbers, notes, text, ec... all good 👍

clemrdh avatar Aug 26 '22 11:08 clemrdh

Pitty, have forked and update the plugin : https://github.com/clemrdh/obsidian-koreader-sync/

Now it works with page numbers, notes, text, ec... all good 👍

Sorry I have no time right now but if you are kind enough to open a PR I'll do my best to approve it

Edo78 avatar Aug 26 '22 11:08 Edo78

Pitty, have forked and update the plugin : https://github.com/clemrdh/obsidian-koreader-sync/ Now it works with page numbers, notes, text, ec... all good 👍

Sorry I have no time right now but if you are kind enough to open a PR I'll do my best to approve it

https://github.com/Edo78/obsidian-koreader-sync/pull/64

mthlvt avatar Sep 06 '22 05:09 mthlvt

@clemrdh

I had the same problem. Look in the .lua file (in your metadata folder of the book on your Koreader device (folder ending by .sdr)

Screenshot 2022-12-18 125357

Screenshot 2022-12-18 125426 When there are multiple authors, there may be a line skip with an antislash. Correct it in the .lua file so both authors are on the same line without line skip.

WHIT THE LINE SKIP CAUSING THE ISSUE Screenshot 2022-12-18 125844

WITHOUT THE LINE SKIP (To fix the issue) Screenshot 2022-12-18 125241

cedryck1 avatar Dec 18 '22 17:12 cedryck1

Hey is this ever going to get merged? I seem to be having this same issue.

thegreekgeek avatar Apr 29 '24 21:04 thegreekgeek