mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Fix for by_author sorting error introduced with sort_key
This commit is contained in:
parent
0e23e6ec19
commit
47119d6f42
@ -1294,7 +1294,7 @@ Author '{0}':
|
|||||||
def add_books_to_HTML_by_month(this_months_list, dtc):
|
def add_books_to_HTML_by_month(this_months_list, dtc):
|
||||||
if len(this_months_list):
|
if len(this_months_list):
|
||||||
|
|
||||||
this_months_list = sorted(this_months_list, key=self.booksByAuthorSorter_author_sort)
|
this_months_list = sorted(this_months_list, key=lambda x: sort_key(self.booksByAuthorSorter_author_sort(x)))
|
||||||
|
|
||||||
# Create a new month anchor
|
# Create a new month anchor
|
||||||
date_string = strftime(u'%B %Y', current_date.timetuple())
|
date_string = strftime(u'%B %Y', current_date.timetuple())
|
||||||
@ -3091,14 +3091,14 @@ Author '{0}':
|
|||||||
Sort non-series books before series books
|
Sort non-series books before series books
|
||||||
'''
|
'''
|
||||||
if not book['series']:
|
if not book['series']:
|
||||||
key = '%s %s' % (capitalize(book['author_sort']),
|
key = '%s ~%s' % (capitalize(book['author_sort']),
|
||||||
capitalize(book['title_sort']))
|
capitalize(book['title_sort']))
|
||||||
else:
|
else:
|
||||||
index = book['series_index']
|
index = book['series_index']
|
||||||
integer = int(index)
|
integer = int(index)
|
||||||
fraction = index-integer
|
fraction = index-integer
|
||||||
series_index = '%04d%s' % (integer, str('%0.4f' % fraction).lstrip('0'))
|
series_index = '%04d%s' % (integer, str('%0.4f' % fraction).lstrip('0'))
|
||||||
key = '%s ~%s %s' % (capitalize(book['author_sort']),
|
key = '%s %s %s' % (capitalize(book['author_sort']),
|
||||||
self.generateSortTitle(book['series']),
|
self.generateSortTitle(book['series']),
|
||||||
series_index)
|
series_index)
|
||||||
return key
|
return key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user