mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Better sorting in collection management
This commit is contained in:
parent
d9cd3fd0b0
commit
0e3a2fc39d
1 changed files with 7 additions and 4 deletions
|
|
@ -216,14 +216,17 @@ def get_collections(self, collection_attributes):
|
|||
elif is_series:
|
||||
if doing_dc:
|
||||
collections[cat_name][lpath] = \
|
||||
(book, book.get('series_index', sys.maxint), '')
|
||||
(book, book.get('series_index', sys.maxint),
|
||||
book.get('title_sort', 'zzzz'))
|
||||
else:
|
||||
collections[cat_name][lpath] = \
|
||||
(book, book.get(attr+'_index', sys.maxint), '')
|
||||
(book, book.get(attr+'_index', sys.maxint),
|
||||
book.get('title_sort', 'zzzz'))
|
||||
else:
|
||||
if lpath not in collections[cat_name]:
|
||||
collections[cat_name][lpath] = \
|
||||
(book, book.get('title_sort', 'zzzz'), '')
|
||||
(book, book.get('title_sort', 'zzzz'),
|
||||
book.get('title_sort', 'zzzz'))
|
||||
# Sort collections
|
||||
result = {}
|
||||
|
||||
|
|
@ -237,7 +240,7 @@ def none_cmp(xx, yy):
|
|||
return 1
|
||||
if y is None:
|
||||
return -1
|
||||
if isinstance(x, unicode):
|
||||
if isinstance(x, (unicode, str)):
|
||||
c = cmp(sort_key(x), sort_key(y))
|
||||
else:
|
||||
c = cmp(x, y)
|
||||
|
|
|
|||
Loading…
Reference in a new issue