From 16d268de60dec8cb2c3163c2a865b9c098bcb970 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 May 2008 10:09:53 -0700 Subject: [PATCH] Implement sub-sorting --- src/calibre/library/database.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/database.py b/src/calibre/library/database.py index 0e4603460b..66dda202c9 100644 --- a/src/calibre/library/database.py +++ b/src/calibre/library/database.py @@ -857,7 +857,10 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE; sort = field + ' ' + order if field == 'series': sort += ',series_index '+order - + elif field == 'title': + sort += ',author_sort ' + order + else: + sort += ',title '+order self.cache = self.conn.execute('SELECT * from meta ORDER BY '+sort).fetchall() self.data = self.cache