calibre-web icon indicating copy to clipboard operation
calibre-web copied to clipboard

Kobo: restore archived book

Open ghost opened this issue 4 years ago • 10 comments

More of a question.

After archiving a book, how can I get it back on my device?

I have removed it from archive in cw. But the next sync does not restore it.

ghost avatar Feb 04 '21 04:02 ghost

I've found a solution for the interim.

If you change the date in calibre for a given book it will sync again. Just the date column, not published.

ghost avatar Feb 04 '21 13:02 ghost

I fixed (and introduced) a lot of bugs related to kobo sync. In my experiments it now worked. Please check again

OzzieIsaacs avatar Dec 06 '21 20:12 OzzieIsaacs

I can't get removed books from my kobo to resync regardless. Changing the date or unarchiving makes no difference.

The only way I can get a book to appear again is to edit the kobo DB to add back my user ID in the content table. This then allows me to reach out to the server and download again.

nwskier avatar Jan 16 '22 07:01 nwskier

So the best way I can come up with to add a book back, is to remove the DB entry from the app.db (kobo synced table) manually. Obviously not ideal, but the quickest way to fix sync issues I've found.

nwskier avatar Jan 16 '22 08:01 nwskier

Which version are you using?

OzzieIsaacs avatar Jan 16 '22 08:01 OzzieIsaacs

Which version are you using?

The latest stable build, though I have just switched over to the nightly to fix the epub reader pic issue. Planning on staying on nightly but can't test the kobo sync until adding books to a shelf is fixed... So I will standby on that issue first.

nwskier avatar Jan 17 '22 04:01 nwskier

Is it possible that the issue comes from the archived_book table in app.db not updating? I found that after archiving a book on my kobo, syncing, then unarchiving that book in calibre-web that it couldn't be resynced to my kobo.

The archived books section of calibre-web was empty but the archived_books table was still filled with the book ids.

carterjgreen avatar Jun 24 '22 18:06 carterjgreen

For anyone else stumbling upon this issue, here is a way that you can force the book to re-sync. It is not perfect and hopefully this bug will be remedied. In this case I accidentally deleted and archived a book from my kobo, and was then unable to re-sync it. The steps I followed to get it to re-sync are:

  1. Stop calibre-web
  2. Find the metadata.db file (in your calibre library that you configured when you initially started the application) and open it with sqlite3 metadata.db
  3. Run the command select * from books; and look for your book. The first number (before the first | on the line) is your Book ID. Keep track of this.
  4. Log out of the database with Ctrl+D
  5. Find the app.db file (in the .calibre-web directory. This is either in the CWD of your process or the homedir of the user running the process) and run sqlite3 app.db
  6. delete from archived_book where book_id = X; where X is the ID of your book that you got from step 3.
  7. Figure out what the shelf ID of your shelf is by running select * from shelf; and looking for the name. The ID is the first number again.
  8. Add your book back to your shelf by running INSERT INTO book_shelf_link (book_id, shelf, date_added) VALUES ('X', 'Y', CURRENT_TIMESTAMP); where X is your Book ID and Y is your Shelf ID.
  9. Log out with Ctrl+D
  10. Start calibre-web
  11. Back on your Kobo, re-sync. The book should now appear on your device and in your collection again.

I hope that this helps someone. I tried to replicate effectively the same steps in the web interface, but I was not met with success.

rs-gh-asdf avatar Oct 24 '22 05:10 rs-gh-asdf

Just experienced this issue yesterday. Had a look at the access log and sync process and it seems that the Kobo readers seemingly keep sending requests to remove archived books from its collections every time a sync is initiated. I don't think books should be removed from shelves when archived anyway, so perhaps need to find some workaround to ignore this.

edit: Maybe it's also awaiting some feedback during the sync that a book has been archived, so the reader knows it no longer needs to request the removal, but not sure how the Kobo API handles this.

ngdio avatar May 22 '23 18:05 ngdio