mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 09:56:18 +01:00
MTP driver: Fix sorting on the title column of the device view. Fixes #1067562 (V 0.9.2 Sort on Title or Author doesn't work)
This commit is contained in:
parent
c612c17db5
commit
62c80eb670
1 changed files with 7 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
import os
|
||||
|
||||
from calibre.devices.interface import BookList as BL
|
||||
from calibre.ebooks.metadata import title_sort
|
||||
from calibre.ebooks.metadata.book.base import Metadata
|
||||
from calibre.ebooks.metadata.book.json_codec import JsonCodec
|
||||
from calibre.utils.date import utcnow
|
||||
|
|
@ -62,6 +63,12 @@ def __ne__(self, other):
|
|||
def __hash__(self):
|
||||
return hash((self.storage_id, self.mtp_relpath))
|
||||
|
||||
@property
|
||||
def title_sorter(self):
|
||||
ans = getattr(self, 'title_sort', None)
|
||||
if not ans or self.is_null('title_sort') or ans == _('Unknown'):
|
||||
ans = ''
|
||||
return ans or title_sort(self.title or '')
|
||||
|
||||
class JSONCodec(JsonCodec):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue