View Single Post
Old 09-23-2022, 11:05 AM   #23
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,482
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by matmp View Post
Create a custom column
(find in : [URL=https://www.reddit.com/r/Calibre/comments/s48dzy/how_to_find_entries_that_dont_have_actual_files/[/URL])
Quote:
Originally Posted by Sirtel View Post
This does not find the missing formats Calibre doesn't know about, e.g. in the case of database corruption or errors in the library.
Although I can't see why one would want such a column, this template does tell you if formats exist in the database but not on the disk and is appropriate for a custom column. Its performance isn't ideal.
Code:
program:
	on_disk = list_re(formats_sizes(), ',', '^(.*):.*$', '\1');
	in_db = approximate_formats();
	list_equals(in_db, ',', on_disk, ',', 'OK', 'Missing some of ' & in_db)
Assuming for some reason I don't want to use Check library, I would use a variant of the above template in a template search. That way I pay the performance penalty only when I want to. This template would work:
Code:
program:
	on_disk = list_re(formats_sizes(), ',', '^(.*):.*$', '\1');
	in_db = approximate_formats();
	list_equals(in_db, ',', on_disk, ',', 'OK', 'BAD')
with this template search:
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	130
Size:	69.1 KB
ID:	196734  
chaley is offline   Reply With Quote