View Single Post
Old 07-21-2019, 08:34 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ceridwen View Post
I may have been mistaking the lack of ToC and metadata update for lack of change. I just tested this again now, with "Do not treat replacements as new books" off, and it did update the title and metadata correctly. (I'm sure the option was checked because that was the default.)
I'm pretty sure it was being replaced, but with no ToC changes. If you were updating a downloaded book because of an extra chapter being added, not seeing it in the ToC would have seemed to be evidence that it wasn't changed.
Quote:
However, in Calibre itself, because I had an existing copy of this book, I now end up with two copies of the same book (one with the old file, one with the new), though only one copy can be on the device at one time. How does this option interact with the main Calibre option to "Auto-merge existing books" under Adding Books in the Preferences menu?
The calibredb command with the appropriate options should solve this. I normally do this through the GUI so haven't looked at the command options properly.
Quote:
This updates the underlying file in the Calibre DB, but doesn't send the file to the Kobo, even if I have it connected when I run the command. FYI, davidfor, when I executed the following steps I encountered what might be a bug:

1. Add calibredb add_format <book_id> <file_name>
2. Unplug Kobo.
3. Check on the Kobo that the book didn't update (the underlying file, the metadata, and the ToC were still using the same version).
4. Plug Kobo back in to the computer.
5. Start the Calibre GUI, find the correct entry, and hit "Send book to device."
6. Close Calibre GUI and unmount the Kobo file system.
7. Open the book.
That's what I would be doing, though normally through the UI.
Quote:
The first time I tried to open it, the Kobo told me that I was trying to open an Adobe DRM-protected Epub and reset my reading position. This is an AO3 book, so it's definitely not DRMed. (I didn't have bookmarks so I don't know if it reset that too.) I could open it and read it on a subsequent attempt, but it seems something with the database was slightly broken.
I get the DRM error occasionally. It is can be a sign the database is corrupt. But, it can also be cleared by restarting the device. In that case, I assume a memory leak or a stuck process. But, I haven't had it for a while.
Quote:
I'm assuming this is the matching DB function to the CLI add_format: https://manual.calibre-ebook.com/db_...che.add_format. What function do I need to call to execute the second step of this flow, getting it to send the updated book to the device?
The API for the device driver is at https://manual.calibre-ebook.com/plu...ices.interface. I don't see anything suitable to use there. "upload_books" would be the first thought, but that isn't where I would have started. It uses a list of file names rather than a list of ids from the library. It actually looks like you could use it to send a book to the device without adding it to the calibre library.

There doesn't seem to be a send-to-device command for the calibredb. But, there is an "export" command which will save the book to disk. You could use this with the path on the device. That would actually bypass all the driver options which would mean the device would import it as new all the time.
davidfor is offline   Reply With Quote