Quote:
Originally Posted by anamardoll
Husband says that yes, SQLiteExpert is trying to open/load the views. So... mystery solved, I guess. But the problem remains that Calibre2opds cannot open my metadata.db file and if neither the tool nor the developer can open it *and* it was working in December and I've changed nothing except update Calibre, then it seems like something is wrong. 
|
My guess is that you added books or changed metadata. If calibre2opds has data sensitivities, these changes could prevent it from working.
If you upgraded calibre from a version older than 0.8.9, then calibre's DB will also have been upgraded. It might be necessary to upgrade calibre2opds.
Quote:
Restore database retained my custom columns, but lost all the tagging data associated with them. So custom column "Source" was still there, but the actual data that X book was Source --> Amazon was gone. You say this means that the opf files are corrupt. Yay?
|
The values to restore for a book are in the OPF. If the values are not being restored, then that argues that the OPF is not correct. However, looking at the code it might be that I didn't handle enumerated column types (column with fixed set of values) correctly, especially if the enumeration changed after it was used. Is "Source" an enumerated column? If the problem I suspect exists, then during the restore you would have seen a message that "Source" has conflicting custom column definitions. Did you?
[EDIT] The restore code is correct after all. It obtains the list of permitted values from the latest OPF, so changes to the list are accounted for.
You can ensure that the column definitions and OPF contents are correct by using Library -> Library Maintenance -> Start backing up metadata ... This will rewrite all the OPFs. It can take a while, as calibre writes a book a second (or thereabouts).
Another point that follows on Kovid's suggestion: calibre's "Check Library" function dumps the database to SQL, recreates it, then restores it from the dumped SQL. This process will eliminate any structural corruption (unless the official SQLite is broken) and will also eliminate any data integrity corruption. Restore your backup, start calibre, and run check library. If that completes successfully, and if calibre can be stopped and restarted, then the probability of DB structural or data corruption approaches zero. Try calibre2opds. If it still cannot open the database, then one should look carefully at calibre2opds for the problem.