mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
RPUB/MOBI Catalog generation: Allow matching empty fields in exclusion rules. Fixes #1814458 [catalog builder ignore "any" and "undefined"](https://bugs.launchpad.net/calibre/+bug/1814458)
This commit is contained in:
parent
7c5184cef8
commit
58442a478a
@ -4807,6 +4807,8 @@ class CatalogBuilder(object):
|
||||
field_contents = self.db.get_field(record['id'],
|
||||
field,
|
||||
index_is_id=True)
|
||||
if field_contents == '':
|
||||
field_contents = None
|
||||
|
||||
if (self.db.metadata_for_field(field)['datatype'] == 'bool' and
|
||||
field_contents is None):
|
||||
@ -4839,6 +4841,10 @@ class CatalogBuilder(object):
|
||||
else:
|
||||
if record not in filtered_data_set:
|
||||
filtered_data_set.append(record)
|
||||
elif field_contents is None and pat == 'None':
|
||||
exclusion_set.append(record)
|
||||
if record in filtered_data_set:
|
||||
filtered_data_set.remove(record)
|
||||
else:
|
||||
if (record not in filtered_data_set and
|
||||
record not in exclusion_set):
|
||||
|
Loading…
x
Reference in New Issue
Block a user