View Single Post
Old 07-21-2019, 06:45 PM   #4
ceridwen
Enthusiast
ceridwen began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Feb 2017
Device: Kobo Aura H2O
Quote:
Originally Posted by davidfor View Post
As you mention updating online serials, I think your problem is that when you to send an updated copy of the book to the Kobo device, the ToC and metadata do not get updated. If that is the problem, there is something really simple you can do: Turn off the "Do not treat replacements as new books" option in the driver. This is on the second tab of both the KoboTouch and KoboTouchExtended drivers. For updating the metadata, there are options in the driver to do this each time the device is connected.

The reason for this is that when the Kobo device sees a new sideloaded book, it imports details from it to the internal database. These details include the metadata and the ToC. When a book is changed (based on file size), it deletes the book details from the internal database and imports it as a new book. But, this means you lose the reading status, annotations and collections.

The early firmware didn't do this. If you updated a book, it just accepted it. When this changed, I worked out how to prevent it and updated the KoboTouch driver (and hence the KoboTouchExtended driver) to handle resending a book this way. My logic was that if you were only making changes to things like spelling or styles, you didn't want to lose the reading status. And, if you made deeper changes you could delete the book first. That was the best of both worlds. But, due to several requests, I added the above option to the driver last year. That way people could chose which behaviour they want. The option is on by default as that is what the behaviour was before the option was added. I think turning off the option will do what you want.
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.)

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?

Quote:
Originally Posted by BetterRed
The calibredb add_format command does it, you need the book id. There's switch to allow/prevent overwriting of existing format.
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.

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'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?
ceridwen is offline   Reply With Quote