mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow calibredb list to output only book ids
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
694dfe5dc2
@ -921,7 +921,7 @@ class ResultCache(SearchQueryParser): # {{{
|
||||
def remove(self, id):
|
||||
try:
|
||||
self._uuid_map.pop(self._data[id][self._uuid_column_index], None)
|
||||
except IndexError:
|
||||
except (IndexError, TypeError):
|
||||
pass # id is out of bounds -- no uuid in the map to remove
|
||||
try:
|
||||
self._data[id] = None
|
||||
|
@ -199,6 +199,7 @@ def command_list(args, dbpath):
|
||||
afields.add('*'+f)
|
||||
if data['datatype'] == 'series':
|
||||
afields.add('*'+f+'_index')
|
||||
if opts.fields.strip():
|
||||
fields = [str(f.strip().lower()) for f in opts.fields.split(',')]
|
||||
if 'all' in fields:
|
||||
fields = sorted(list(afields))
|
||||
@ -208,6 +209,8 @@ def command_list(args, dbpath):
|
||||
prints(_('Invalid fields. Available fields:'),
|
||||
','.join(sorted(afields)), file=sys.stderr)
|
||||
return 1
|
||||
else:
|
||||
fields = []
|
||||
|
||||
if not opts.sort_by in afields and opts.sort_by is not None:
|
||||
parser.print_help()
|
||||
|
Loading…
x
Reference in New Issue
Block a user