Make author sorting on the device case insensitive

This commit is contained in:
Kovid Goyal 2012-09-14 14:35:45 +05:30
parent 987b0a28ac
commit 8b85e25020
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import time
from calibre.utils.date import parse_date from calibre.utils.date import parse_date
from calibre.devices.usbms.books import Book as Book_ from calibre.devices.usbms.books import Book as Book_
from calibre.ebooks.metadata import author_to_author_sort
class Book(Book_): class Book(Book_):
@ -20,6 +21,7 @@ class Book(Book_):
self.authors = [''] self.authors = ['']
else: else:
self.authors = [authors] self.authors = [authors]
self.author_sort = author_to_author_sort(self.authors[0])
if not title: if not title:
self.title = _('Unknown') self.title = _('Unknown')

View File

@ -1193,6 +1193,9 @@ class DeviceBooksModel(BooksModel): # {{{
ax = authors_to_string(self.db[x].authors) ax = authors_to_string(self.db[x].authors)
except: except:
ax = '' ax = ''
try:
return sort_key(ax)
except:
return ax return ax
keygen = { keygen = {