From 5ca115eab0e3d895ef2e6e8e4586c276909226f7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Oct 2013 10:08:37 +0530 Subject: [PATCH] calibredb: Allow setting fo title sort field Fixes #1233711 [CalibreDB: title_sort is not a known field](https://bugs.launchpad.net/calibre/+bug/1233711) --- src/calibre/library/cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index 89989102e2..f0760e7439 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -629,9 +629,12 @@ def command_set_metadata(args, dbpath): if opts.field: fields = {k:v for k, v in fields()} + fields['title_sort'] = fields['sort'] vals = {} for x in opts.field: field, val = x.partition(':')[::2] + if field == 'sort': + field = 'title_sort' if field not in fields: print >>sys.stderr, _('%s is not a known field'%field) return 1