Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-12-2012, 08:41 PM   #1
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
deleting corrupted directories

I had a Calibre Library that was corrupted during copying of that library when I ran out of filespace on the receiving flash drive. Calibre reports that the library is ok when running a check library, but with many of the 'books' now listed, the ebook format is no longer present in the directory, only the cover.jpg and metadata file. Unfortunately, with a 4000+ "book" library, I don't want to go through the listing one at a time and deleting those that don't have an ebook present. I am running Calibre 0.9.2 on Ubuntu 12.04. Is there a script that can be used to delete all the authors/book directories that don't have an ebook file present within them?

An example sample library is attached. It has two "books" listed, one being renamed "Example of Good Directory" and the other "Example of Bad Directory." The 'good example' has a pdf files listed, but it's actually a 2 byte text file renamed pdf so that the filesize is significantly smaller than the original. The covers have been scaled down to 100x120 or so. Running the library maintenance on this reports no errors.

Thank you.

Maybe in future versions the Library Maintenance can be changed to check if a "book" actually exists in the directory, and then gives an option to delete that book if not present.
Attached Files
File Type: zip examplelibrary.zip (18.7 KB, 52 views)

Last edited by jebradley; 10-12-2012 at 08:48 PM. Reason: Forgot to add the attachment.
jebradley is offline   Reply With Quote
Old 10-12-2012, 08:48 PM   #2
theducks
Grand Sorcerer
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: 14,705
Karma: 5643657
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by jebradley View Post
I had a Calibre Library that was corrupted during copying of that library when I ran out of filespace on the receiving flash drive. Calibre reports that the library is ok when running a check library, but with many of the 'books' now listed, the ebook format is no longer present in the directory, only the cover.jpg and metadata file. Unfortunately, with a 4000+ "book" library, I don't want to go through the listing one at a time and deleting those that don't have an ebook present. I am running Calibre 0.9.2 on Ubuntu 12.04. Is there a script that can be used to delete all the authors/book directories that don't have an ebook file present within them?

An example sample library is attached. It has two "books" listed, one being renamed "Example of Good Directory" and the other "Example of Bad Directory." The 'good example' has a pdf files listed, but it's actually a 2 byte text file renamed pdf so that the filesize is significantly smaller than the original. The covers have been scaled down to 100x120 or so. Running the library maintenance on this reports no errors.

Thank you.

Maybe in future versions the Library Maintenance can be changed to check if a "book" actually exists in the directory, and then gives an option to delete that book if not present.
The second phase does the check and finds missing AND extra stuff. expanding the + signs allos you to mark and perform some corrective actions
theducks is offline   Reply With Quote
Old 10-12-2012, 10:25 PM   #3
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
Take a look at the library that I attached to my message.
When you run the 'Library Maintenance->Check Library' you get the message "Found no errors in your calibre library database. ..." When I checked 'Yes,' I got the message "The files in your library match the information in the database."
After reading theduck's post, I re-ran things and got an error in the second phase about the author being incorrect, and after deleting the only thing that I could check, it again states that there are no errors in the first phase, and the second phase states that the information matches.
The second book, "Example of a Bad Book Directory" is still present, and does not contain a document file, only the metadata and cover.jpg.
jebradley is offline   Reply With Quote
Old 10-12-2012, 10:43 PM   #4
BetterRed
null operator
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: 3,505
Karma: 2177990
Join Date: Mar 2012
Location: NSW Australia
Device: none
If you click on Formats in the Tag Browser a couple of times until its a red Minus sign you should see all the books with no valid book file (EPUB, MOB, TXT etc) - ie folders with just an OPF and maybe a cover file.

See piccie

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	60
Size:	70.2 KB
ID:	94034  
BetterRed is online now   Reply With Quote
Old 10-12-2012, 11:20 PM   #5
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
The sample library that I posted has no files listed when the red Minus sign is present, yet if you look at the title, "Example of a Bad Book Directory", you will see that the information lists Authors, Tags, and Path. There is NO ebook format listed.

Last edited by jebradley; 10-12-2012 at 11:21 PM. Reason: Should have said library rather than directory
jebradley is offline   Reply With Quote
Old 10-13-2012, 12:00 AM   #6
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
To BetterRed
The tag browser, when + lists all the 'books' that you have entered tag information. When -, it lists all the files that have no tag information listed. It doesn't have anything to do with whether a document file is present.
jebradley is offline   Reply With Quote
Old 10-13-2012, 12:20 AM   #7
theducks
Grand Sorcerer
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: 14,705
Karma: 5643657
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
What you describe is an 'Empty Book' (metadata only). IMHO useful to keep track of books belonging to a series, but not owned. Public Library books that have been read (and the book checked back in )
This is a 100% valid condition, which is why the maintenance did not flag it.

If someone HAD gone into the file system and deleted the format, the error would be flagged (Calibre keeps track of formats stored) as MISSING.
theducks is offline   Reply With Quote
Old 10-13-2012, 01:36 AM   #8
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
Well, unfortunately, my library was corrupted during a failed copy/erase when the receiving thumb drive was full. It was not due to turning in a library book. And, my library of 4886 document titles is too many to go one by one to see if there is a document present.
This discussion did get me looking at the various information tabs available. I did a search of formats:"=EPUB" or formats:"=PDF" or formats: ... for all the document types, and then highlighted all of the titles displayed. I'm doing a copy/erase to another directory. If things work as I expect, I should be left with only those titles that have no document within their directory. I can then delete these. This is much faster than going file by file. I suspect this is going to work, but there are quite a few files being transferred. So we'll wait and see.
It would be nice, if under the formats tab, that a no formats present tab was present.
jebradley is offline   Reply With Quote
Old 10-13-2012, 03:36 AM   #9
BetterRed
null operator
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: 3,505
Karma: 2177990
Join Date: Mar 2012
Location: NSW Australia
Device: none
Quote:
Originally Posted by jebradley View Post
To BetterRed
The tag browser, when + lists all the 'books' that you have entered tag information. When -, it lists all the files that have no tag information listed. It doesn't have anything to do with whether a document file is present.
On my system the Format Tags are "automatic" in that I don't have to do anything other than to add or remove files of recognised formats to a book to update the Formats section of the Tag Browser.

Hence a search of formats:false (which is what the Red Minus on the Formats Tag equates to) will show all 'books' that don't have any known book format files.

But I suspect I've misunderstood your problem, sorry about that

BR
BetterRed is online now   Reply With Quote
Old 10-13-2012, 04:57 AM   #10
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,058
Karma: 777825
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
If you want to find book entries that have no associated ebook format then you can search using
Code:
formats:false
You can then decide if you want to remove the identified book entries from the Calibre database.

As was mentioned many people (myself included) use book entries with no attached ebook format for purposes such as wish list entries and tracking paper/audio books so there is no way Calibre should ever not allow this scenario.
itimpi is offline   Reply With Quote
Old 10-13-2012, 07:21 AM   #11
theducks
Grand Sorcerer
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: 14,705
Karma: 5643657
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by jebradley View Post
Well, unfortunately, my library was corrupted during a failed copy/erase when the receiving thumb drive was full. It was not due to turning in a library book. And, my library of 4886 document titles is too many to go one by one to see if there is a document present.
This discussion did get me looking at the various information tabs available. I did a search of formats:"=EPUB" or formats:"=PDF" or formats: ... for all the document types, and then highlighted all of the titles displayed. I'm doing a copy/erase to another directory. If things work as I expect, I should be left with only those titles that have no document within their directory. I can then delete these. This is much faster than going file by file. I suspect this is going to work, but there are quite a few files being transferred. So we'll wait and see.
It would be nice, if under the formats tab, that a no formats present tab was present.
From what you indicate: You have a 'clean library'. By 'clean', Calibre acknowledges that there are books without any formats (just the cover that Calibre shows you and the metadata backup file)

If you want those all GONE.
Search: formats:false
Select all (results)
Tap the Delete key
theducks is offline   Reply With Quote
Old 10-13-2012, 04:23 PM   #12
jebradley
Member
jebradley began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2011
Device: none
Thank you.
The 'formats:false' was the key that i needed.
jebradley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
double directories sar026@gmail.com Calibre 2 10-02-2012 07:47 AM
Directories and book import JulioQc Library Management 3 05-02-2012 12:36 PM
PRS-600 Can somebody explain the directories? Cue Sony Reader 5 01-19-2012 07:31 AM
Default Directories goldberry Library Management 8 04-10-2011 12:56 PM
Classic Nooklibrary : Allows Directories management? Kolfe Barnes & Noble NOOK 3 11-08-2010 09:00 AM


All times are GMT -4. The time now is 10:29 PM.


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