mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
calibredb list: Allow outputting the languages field as well. Fixes #1445853 [Calibredb list does not export languages](https://bugs.launchpad.net/calibre/+bug/1445853)
This commit is contained in:
parent
13c5fdb2be
commit
0dd3fc7f2e
@ -21,10 +21,11 @@ from calibre.ebooks.metadata.opf2 import OPFCreator, OPF
|
|||||||
from calibre.utils.date import isoformat
|
from calibre.utils.date import isoformat
|
||||||
from calibre.utils.localization import canonicalize_lang
|
from calibre.utils.localization import canonicalize_lang
|
||||||
|
|
||||||
FIELDS = set(['title', 'authors', 'author_sort', 'publisher', 'rating',
|
FIELDS = {
|
||||||
'timestamp', 'size', 'tags', 'comments', 'series', 'series_index',
|
'title', 'authors', 'author_sort', 'publisher', 'rating', 'timestamp',
|
||||||
'formats', 'isbn', 'uuid', 'pubdate', 'cover', 'last_modified',
|
'size', 'tags', 'comments', 'series', 'series_index', 'formats', 'isbn',
|
||||||
'identifiers'])
|
'uuid', 'pubdate', 'cover', 'last_modified', 'identifiers', 'languages'
|
||||||
|
}
|
||||||
|
|
||||||
do_notify = True
|
do_notify = True
|
||||||
def send_message(msg=''):
|
def send_message(msg=''):
|
||||||
@ -203,8 +204,8 @@ List the books available in the calibre database.
|
|||||||
|
|
||||||
def command_list(args, dbpath):
|
def command_list(args, dbpath):
|
||||||
pre = get_parser('')
|
pre = get_parser('')
|
||||||
pargs = [x for x in args if x.startswith('--with-library') or x.startswith('--library-path')
|
pargs = [x for x in args if x.startswith('--with-library') or x.startswith('--library-path') or
|
||||||
or not x.startswith('-')]
|
not x.startswith('-')]
|
||||||
opts = pre.parse_args(sys.argv[:1] + pargs)[0]
|
opts = pre.parse_args(sys.argv[:1] + pargs)[0]
|
||||||
db = get_db(dbpath, opts)
|
db = get_db(dbpath, opts)
|
||||||
parser = list_option_parser(db=db)
|
parser = list_option_parser(db=db)
|
||||||
@ -1318,6 +1319,7 @@ def command_restore_database(args, dbpath):
|
|||||||
dbpath = dbpath.decode(preferred_encoding)
|
dbpath = dbpath.decode(preferred_encoding)
|
||||||
|
|
||||||
class Progress(object):
|
class Progress(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.total = 1
|
self.total = 1
|
||||||
|
|
||||||
@ -1555,4 +1557,3 @@ def main(args=sys.argv):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user