From f99359a1628895d2dbd1e2ede7642b3c8166e1a5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 11 Oct 2010 08:33:24 -0600 Subject: [PATCH] Use the title_sort tweak when sorting the books in the device view as well --- src/calibre/devices/usbms/books.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index a267d18584..c8b2638690 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -6,6 +6,7 @@ __docformat__ = 'restructuredtext en' import os, re, time, sys +from calibre.ebooks.metadata import title_sort from calibre.ebooks.metadata.book.base import Metadata from calibre.devices.mime import mime_type_ext from calibre.devices.interface import BookList as _BookList @@ -54,7 +55,7 @@ class Book(Metadata): def title_sorter(self): doc = '''String to sort the title. If absent, title is returned''' def fget(self): - return re.sub('^\s*A\s+|^\s*The\s+|^\s*An\s+', '', self.title).rstrip() + return title_sort(self.title) return property(doc=doc, fget=fget) @dynamic_property