View Single Post
Old 07-08-2023, 06:54 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by geekraver View Post
That's a good option. It may still be worth a PR though; it seems like missing functionality in the database repair options. If I have a format not in the DB, it seems reasonable to want to either add it to the database or delete it from the file system; right now only the latter is available.
Working out whether some random file in the book folder is in fact an addable format is non-trivial. You must determine a) whether it is a valid format file type, b) determine if there isn't already such a format, c) determine that the book record actually exists, then d) whether the format will have the same name, which if true can cause data loss. Then you must e) add the format, and f) delete the "random file", both in a reliable (atomic) way. In the "check database" context you must do this on a folder-by-folder basis, controlling the fix options appropriately.

If you want to take this on then have at it, but bear in mind that in this case "you touched it last".
chaley is offline   Reply With Quote