Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-16-2016, 12:12 PM   #1
excaliber
Connoisseur
excaliber began at the beginning.
 
excaliber's Avatar
 
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!
excaliber is offline   Reply With Quote
Old 06-16-2016, 12:36 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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 recovering your library
theducks is offline   Reply With Quote
Advert
Old 06-16-2016, 03:43 PM   #3
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by excaliber View Post
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.
It would have been just as easy to delete them from within Calibre.
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 ;-)
kacir is offline   Reply With Quote
Old 06-16-2016, 06:27 PM   #4
excaliber
Connoisseur
excaliber began at the beginning.
 
excaliber's Avatar
 
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...
excaliber is offline   Reply With Quote
Old 06-17-2016, 02:50 AM   #5
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by excaliber View Post
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.
A book record can exist even if it has no file format associated with it (at the moment).
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.
kacir is offline   Reply With Quote
Advert
Old 06-17-2016, 07:29 AM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kacir View Post
A book record can exist even if it has no file format associated with it (at the moment).
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.
...
- and some people maintain a catalogue of their physical books in a calibre library, in my case those books will never have an ebook format file.

BR
BetterRed is online now   Reply With Quote
Old 06-17-2016, 09:43 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Quote:
Originally Posted by BetterRed View Post
- and some people maintain a catalogue of their physical books in a calibre library, in my case those books will never have an ebook format file.

BR
Me 900 Paperbacks
theducks is offline   Reply With Quote
Old 06-17-2016, 10:00 AM   #8
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Quote:
Originally Posted by theducks View Post
Me 900 Paperbacks
Me too (1200+)
Divingduck is offline   Reply With Quote
Old 06-17-2016, 06:39 PM   #9
excaliber
Connoisseur
excaliber began at the beginning.
 
excaliber's Avatar
 
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!
excaliber is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 07:15 PM.


MobileRead.com is a privately owned, operated and funded community.