Fix a regression in calibre 5.0 that broke sorting the device view by title if one of the books has an empty title. Fixes #2007165 [Cannot sort device by title](https://bugs.launchpad.net/calibre/+bug/2007165)

More py3 goodness
This commit is contained in:
Kovid Goyal 2023-02-14 09:39:10 +05:30
parent 28c3422398
commit 1c30c6f644
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1602,7 +1602,7 @@ class DeviceBooksModel(BooksModel): # {{{
return ax
keygen = {
'title': ('title_sorter', lambda x: sort_key(x) if x else ''),
'title': ('title_sorter', lambda x: sort_key(x) if x else b''),
'authors' : author_key,
'size' : ('size', int),
'timestamp': ('datetime', functools.partial(dt_factory, assume_utc=True)),