-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Kobo sync and large libraries #1276
Comments
You raise an interesting problem.
It turns out the Kobo device already has a solution for this problem, we just haven't been making use of it yet. First some background:
That's definitely doable. I only added "Archiving" to CalibreWeb to support library management for the Kobo, and given your use-case it might have been slightly ill-conceived. Perhaps "Kobo Library View" might be a better name?
It's likely possible as long as the device get's the store url from one of:
I've never looked into it before, so I have no idea how easy or difficult it would be... |
Just had an idea, how about using the shelves system to decide what to sync? Create a shelf for kobo books, with a global toggle to add/remove all books, then sync whatever is in that shelf. Would that work? As an aside, it doesn't look like calibre-web allow for selection and action on multiple books at a time. That could make matters annoying :( |
Maybe? For what it's worth #1266 is also adding support for syncing CalibreWeb shelves to Kobo Collections but I don't think that should interfere. |
IIRC, it comes from the initial API endpoint list. If not, I can write a patch for it. BTW, nice work so far with the Kobo sync API! |
Sorry for the lack of activity here; I can start working on the sync continuation mechanism sometime this week since we'll want that implemented for large libraries regardless of how they're managed. Re-purposing the Archive table so that books can be selected for syncing inclusively as well as exclusively is pretty easy since we probably don't even need to change the database schema nor the Kobo implementation. The CalibreWeb UI can just display the complement of the table content. Perhaps we can also add a button to shelves to add/remove-all to the Archive table? I noticed @OzzieIsaacs has a tool for importing shelves from Calibre that could also be helpful here. Thanks for the encouragment @geek1011 :) . |
My preferred use case would be to have the ability to disable syncing all books by default, then syncing only a few titles at any given time. So there would need to be a way of 'archiving'/'unarchiving' easily from the web UI. |
Hello, Besides that it would be amazing to have listed all the books as a store and be able to "buy/ import/sync" into the kobo device. |
@shavitmichael Any update on the sync continuation mechanism? I'm trying to get a new device up to date against my library and have run into this. If you haven't got the time or energy, I can spare some time to write code if somebody can give me some more detail on how you all would like it to work. |
Sorry for the late response, things are a little busy right now and I probably won't have time to implement this for a few weeks. I have a very incomplete attempt at implementing sync continuation from a few months back, which I've now pushed in commit a8b90ce for others to peruse ; although I left things in a pretty confusing state. IIRC, I was trying to split up the v1/library/sync call into phases, such that we'd only move onto the next "phase" once the previous was up to date. For example, we would:
I forget where exactly I got held up in the implementation, but I think it's possible this idea will run into some edge cases. In addition, suppose there are M entries to update which all have the same last_modified_timestamp, such that M > N. Since the number of entries returned is capped at N, we also add an id to the SyncToken to mark the id of the N'th entry that was returned, so that syncing can resume at that id on the next round. There's some references to this idea in the commit (e.g: books_last_id), although I don't think I finished writing all the code for it. |
I really like the idea of using a shelf or something to sync. I also have a large library I like having access to, but don't need synced all the time |
I would be really interested in this too..is the Dev still on-going? |
Adding a bit more data - I seem to be getting the same thing with a library of around 750 ePubs, 1.3k books in total. That's running in docker on a raspberry pi 4, so it might be happening with a smaller library because of slower response time? |
Having a library with 7k+ ebooks sync failed every time. Made a new library with only a handfull of books and syncing works (almost) like a charme. So I would welcome some of the options already mentioned:
When only having the Kobo at hand the option to work with the library as with the Kobo shop would also be great. Until that time I am afraid I will have to work with 2 libraries. |
In the newest commit version a partial sync is implemented, 100 books are getting synced per request. If there are more books left, kobo should request the next books and continue until all books are synced. You can change the no. of books in kobo.py in the variable SYNC_ITEM_LIMIT until we have found a good no of books to sync. I will not make this setting available to the user interface, as I think there will be a number which fits for all.
You can set the not to sync books to "archived", but I understand that this is not practicable for 7k books, I need time to extend the books table page to mass change books. |
Thank you so much!! Are you planning at some point to add the feature to sync to kobo on only one shelf? |
Thanks. It is working for me. (Kobo Libra H2O) |
I'd happily test this to lend a bit more evidence to the fix but I'm running my setup in docker. Is there a beta build image for this that I could help test? |
Hi guys, can you explain a bit more how the sync with kobo feature works? Does kobo download all the synched books or only a list (catalog) of the books? |
A list. |
I found another problem if you have alot of ebooks. The following line has no limit, so the SYNC LIMIT 100 is not affected but makes my kobo to gives an error because of the initial sync cannot be started:
See for the debug log what i saw when i copy/paste the sync url (https://calibre//kobo/**SECRETTOKEN**/v1/library/sync?Filter=ALL&DownloadUrlFilter=Generic,Android&PrioritizeRecentReads=true) in my browser. The message says it was blocked because of the database. But i was waiting for i think almost 5 minutes.
|
I have finally managed to set up Kobo Sync. My library in calibre-web is almost 900 books, but i can only see around 175 books on my Kobo. Is there a way to get all books visible on my Kobo? |
There is a bug in the Sync, it syncs only 100 Books, so Remove all Books from Library except 100, Sync, add next 100 and so on. Or you could try the Development Branch it‘s working there, But Not Perfect. Or edit kobo.py file Theres a constant no of Books to Sync put it to 1000, Might work (timeout Problem Maybe) |
Thats fine Ozzie, im not in hurry :) After reading the above i was under impression that 100 books is a limit for a single sync (and it will download another 100 during the next one), but thats obviously wrong :) Keep up with the amazing work! |
Syncing books should work now in latest nightly version. Reading status (if changed from calibre-web side) is now also chunked synchronized |
I have around 650 books in my collection and around 470 are fetched/displayed via Kobo sync. I have tried to use the nightly version (via linuxerver.io container) but the rest of the books are not being synced. Am i doing something wrong? I think the book that are not being synced are books that were not in kepub format originally but were cbz and pdf. Is there a way to force a full resync? |
@returntrip I'm sorry Kobo only syncs epub and kepub files. PDF or other formats are not synced, and there is nothing you can do to change this (it's a limitation of kobo) |
No need to apologize :). I am really grateful for all your work on calibre-web and the Kobo sync feature! For those books that were in PDF and cbz, I have uploaded the epub version and then converted them to kepub, but unfortunately they are still not synching. Is there any way to force full resync? Thanks. |
Same issue here. I only have around 185 books synced (out of 1030 epubs in the library) |
I have noticed that my existing library will fail to sync all of the books (which is another issue being reviewed). However, by removing a book in calibre and manually adding it back in, that book will then sync without issue. In this instance it is only the EPUB file being read back into the database, not the metadata xml file. However, using the calibre "Add by folder and sub-folder" option or the import/transfer old library options, the sync does not get initiatied. This import the metadata from the OPF XML file. So it seems there is a flag or variable getting reset when a new item is added direct from epub that is not getting reset using the other methods. I've tried using SQLite queries to interrogate and see which variable is impacting this, but don't seem to have come up with a result |
Hi! I've read the whole thread. I'm facing this issue. I have around 2.000 books (only epubs) on my instance, and on my Kobo Clara HD & Kobo Nia only appears around 1.500. Before reading this issue, my partner and I were reuploading the books thinking we don't have them and then resync, this method works. But after several times facing this issue, I looked up here. So, what can I do now? What is the best option to sync the whole library or to complete the sync with the .epubs that are not showing on ours ereaders? Syncing only shelfs is not an option. Should do I do a fresh install of Calibre-web and try to sync from scratch? Thanks in advance :) Edit: My ereader (Kobo Clara HD) shows 1565 books in my library, my partner's one (Kobo Nia) 1479. Same instance |
Hi,
Why not add a file in /config directory so we can change the value 'on the fly' ? |
Mitigates janeczku#1276 by allowing the user to specify how many items will be synced to a Kobo device in one batch. This is important as Kobo devices have a non-configurable 30s timeout. When running calibre-web on slower servers, the default of 100 items per operation can result in sync errors which prevent any items from being transferred.
This is both a problem report, and a feature request(s) combined, hence the blank issue.
The Problem
My Calibre library now has a few thousand books in it (it's been going for 12 years now...), and my Aura H2O simply times out when attempting to sync with calibre-web. The Kobo eventually gave a 'sync failed' message, and my wireshark capture shows that it gave up at around ~286K characters.
There needs to be some method of making large libraries more usable for kobo sync. A few ideas off the top of my head:
@shavitmichael do you have any ideas or thoughts on this?
The text was updated successfully, but these errors were encountered: