mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
calibredb catalog: Fix --ids and --search options not working for cvx/xml catalogs. Fixes #1955967 ['calibredb catalog' options broken: --ids and --search](https://bugs.launchpad.net/calibre/+bug/1955967)
This commit is contained in:
parent
67cddcea52
commit
9dfa3f89db
@ -512,7 +512,7 @@ class CatalogPlugin(Plugin): # {{{
|
||||
|
||||
db.search(opts.search_text)
|
||||
|
||||
if opts.sort_by:
|
||||
if getattr(opts, 'sort_by', None):
|
||||
# 2nd arg = ascending
|
||||
db.sort(opts.sort_by, True)
|
||||
return db.get_data_as_dict(ids=opts.ids)
|
||||
@ -530,7 +530,7 @@ class CatalogPlugin(Plugin): # {{{
|
||||
all_custom_fields.add(field+'_index')
|
||||
all_fields = all_std_fields.union(all_custom_fields)
|
||||
|
||||
if opts.fields != 'all':
|
||||
if getattr(opts, 'fields', 'all') != 'all':
|
||||
# Make a list from opts.fields
|
||||
of = [x.strip() for x in opts.fields.split(',')]
|
||||
requested_fields = set(of)
|
||||
|
Loading…
x
Reference in New Issue
Block a user