![]() |
#1 |
Connoisseur
![]() Posts: 59
Karma: 10
Join Date: Nov 2013
Device: Samsung Galaxy Tab 2 10.1 P5110
|
How to delete non-existent ebooks from database?
Hi all,
I have deleted many files in the calibre library directory (not the directories and the metadata.opf files), not within calibre itself. Before someone asks why I did this way, the reason in the library were file formats which I didn't want like .txt or .zip files or small size .pdf files and it was easy for me to mark and delete all these kind of files with a file manager. Now there are inconsistencies in the database since the actual files are missing. When I go to Library - Library Maintenance - Check Library I can see in the "Missing book formats" the problematic entries. I want to delete all these entries but there are no check boxes next to them. I could delete all these entries manually by using the id and searching for each entry but this is time consuming. I wonder why there is are no check boxes beside the "Missing book formats" (there is only "fixable") and why the files can be marked by check boxes in the first place. This is OK for some entries but if someone like me has some hundreds of entries clicking one by one is not easily manageable. So, is there any easy way to delete non-existent ebooks from database? What will happen if I just delete the directories together with the including metadata.opf files? Will the database get corrupted? Any suggestions? Thanks in advance! |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
1 Stop doing that
![]() Calibre (GUI) can remove any format. See the arrow on the Delete icon ![]() Run Library Maintainence: Phase 2 will give you a option to fix most of those errors metadata.OPF is your metadata backup Delete it only if you like to struggle ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
Quote:
You can do various complicated filtering, based on file formats, sizes, and many other criteria ... Calibre is a powerful database. All you needed to do was ask here ;-). When you perform library maintenance, check library, you have to select Fix errors. Calibre then corrects the list of file formats associated with each record. Then you can delete books that have no file format associated. The easiest way would be adding your own column, selecting "quick add formats" and then sort by the column "Formats". The first will be books without any file format associated. See, you still have to use Calibre interface, even after deleting files manually ;-) |
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 59
Karma: 10
Join Date: Nov 2013
Device: Samsung Galaxy Tab 2 10.1 P5110
|
I did run the Library Maintenance and clicked to fix them and then all records with "Missing book formats" disappeared. I thought calibre would automagically detect and also delete all non existent ebooks and the relevant directories but it didn't. Then I saw in the "Formats" column that the entries with non existent ebooks were empty so I could easily delete them.
Thank you both for the quick replies. You saved me hours of work... |
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
Quote:
You might want to delete a book file and later add a better one, for example. Or create a few records in advance and then populate them with actual files. The fact that you want to delete a *.txt or other format doesn't automatically mean that you also want to have metadata erased. If you want to learn more about querying Calibre database just open tag browser on the left and select authors, series, formats ... and observe the result in the search bar. Also read the documentation formats:"=DOC" means that Calibre will list all files with *.DOC extension but not *.DOCX formats:"doc" (without the equal sign) will look for all extensions with 'doc' substring, including 'docx', for example. There is also possibility to use [python] regular expressions, with syntax authors:"~RegularExpression", so you can look for records with two commas in author field or other very powerful things. You can, of course, combine search statements with AND, OR, NOT and (). There is, I think also query for a number of formats but I can't find it at this moment. You see, this is much more powerful than a search for files from within file manager. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
![]() BR |
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,939
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
|
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() Posts: 59
Karma: 10
Join Date: Nov 2013
Device: Samsung Galaxy Tab 2 10.1 P5110
|
@kacir: thanks again for the extra information!
Thank you all for your replies. They have been very helpful! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Touch How do I totally clean/delete a suspect database | Joeldmtl | Kobo Reader | 1 | 11-02-2014 02:04 PM |
PRS-T1 How to delete database-entries ? | Schussel | Sony Reader | 3 | 09-08-2012 11:39 AM |
Manually add/delete ebooks to a database | sariel2413 | Calibre | 3 | 03-18-2010 04:45 PM |
just delete books from database not from disk | droople | Calibre | 5 | 01-31-2010 03:43 AM |
How to delete database and start fresh? | fshapps | Calibre | 1 | 02-08-2009 06:28 PM |