mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Better sorting in collection management
This commit is contained in:
parent
d9cd3fd0b0
commit
0e3a2fc39d
@ -216,14 +216,17 @@ class CollectionsBookList(BookList):
|
|||||||
elif is_series:
|
elif is_series:
|
||||||
if doing_dc:
|
if doing_dc:
|
||||||
collections[cat_name][lpath] = \
|
collections[cat_name][lpath] = \
|
||||||
(book, book.get('series_index', sys.maxint), '')
|
(book, book.get('series_index', sys.maxint),
|
||||||
|
book.get('title_sort', 'zzzz'))
|
||||||
else:
|
else:
|
||||||
collections[cat_name][lpath] = \
|
collections[cat_name][lpath] = \
|
||||||
(book, book.get(attr+'_index', sys.maxint), '')
|
(book, book.get(attr+'_index', sys.maxint),
|
||||||
|
book.get('title_sort', 'zzzz'))
|
||||||
else:
|
else:
|
||||||
if lpath not in collections[cat_name]:
|
if lpath not in collections[cat_name]:
|
||||||
collections[cat_name][lpath] = \
|
collections[cat_name][lpath] = \
|
||||||
(book, book.get('title_sort', 'zzzz'), '')
|
(book, book.get('title_sort', 'zzzz'),
|
||||||
|
book.get('title_sort', 'zzzz'))
|
||||||
# Sort collections
|
# Sort collections
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
@ -237,7 +240,7 @@ class CollectionsBookList(BookList):
|
|||||||
return 1
|
return 1
|
||||||
if y is None:
|
if y is None:
|
||||||
return -1
|
return -1
|
||||||
if isinstance(x, unicode):
|
if isinstance(x, (unicode, str)):
|
||||||
c = cmp(sort_key(x), sort_key(y))
|
c = cmp(sort_key(x), sort_key(y))
|
||||||
else:
|
else:
|
||||||
c = cmp(x, y)
|
c = cmp(x, y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user