Quote:
Originally Posted by Jellby
Hmm... When I rename/remove a book I had previously finished, I want the old record to disappear and be transferred to the new book, if any. For the reading status, it's easy to do it on the device or through calibre. For the stats (I care more about the number of books finished, rather than the reading time), I can mark the new one as finished by turning the last page, but I can't easily remove the old "book finished" record. It's this what I'm asking for: a tool to delete records for books that are not on the device (or possible duplicates if old and new book have the same filename, but are counted as different books, I don't know if this can happen).
|
Before my reply last night I did some checking. The exact way that the finished books are counted changed some time ago. It was the number of books marked as finished in the main books table. Now it is done by the event table. That has a record for each finished book with a count for how many time it has been finished. But, it doesn't get created or incremented when you mark the book as finished, only when you read to the end.
There is no current way to remove these records. They aren't deleted when you delete the book. And one of the tests I did last night was to delete them. This reset ALL the counts and the hours. There is probably a checksum or similar being used across all the records in the table.
What this means is that cleaning up these records is a problem. It might be possible to change the id in the table to point to a different book. But, I'm not expecting that to work. There is a checksum on each record. I don't know how this is calculated but it probably includes the id.
If what you want is simply the correct number of finished books, then leaving the records as they are and marking the replacement book as finished will work. If you want to look at the individual stats for a book, then at the moment, you need to make sure the file name doesn't change as that is used for the id in the database.
Also, if the filename doesn't change for a replacement book, the device will remove the book from the database if the file size changes. But, this does not affect the part of the database used for the stats. But, the driver in calibre cheats. It updates the file size in the database. That makes the firmware not reprocess the book as a new one.
Quote:
Right. I thought I had seen that but couldn't find it at the moment of writing. But my suggestion is a tool for doing it automatically for "finished" books, so I don't need to find them and select them.
|
When I get to the clean-up functions, I'll include this. But, I don't think it is something I am likely to add as a separate function that can be automatically started.