From 1c30c6f644306c33c3afbc86440072b36130e8b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Feb 2023 09:39:10 +0530 Subject: [PATCH] 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 --- src/calibre/gui2/library/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index c76ca43a37..a01999dab3 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -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)),