Make the title_sort order tweak respected in more places (hope, everywhere)

This commit is contained in:
Charles Haley 2010-12-20 09:01:43 +00:00
parent 8b56f2d8c7
commit a8065fd715
3 changed files with 7 additions and 4 deletions

View file

@ -57,6 +57,8 @@ def authors_to_sort_string(authors):
def title_sort(title):
title = title.strip()
if tweaks['title_series_sorting'] == 'strictly_alphabetic':
return title
if title and title[0] in _ignore_starts:
title = title[1:]
match = _title_pat.search(title)

View file

@ -1128,6 +1128,10 @@ def get_categories(self, sort='name', ids=None, icon_map=None):
for l in list:
(id, val, sort_val) = (l[0], l[1], l[2])
tids[category][val] = (id, sort_val)
elif cat['datatype'] == 'series':
for l in list:
(id, val) = (l[0], l[1])
tids[category][val] = (id, title_sort(val))
elif cat['datatype'] == 'rating':
for l in list:
(id, val) = (l[0], l[1])

View file

@ -161,10 +161,7 @@ def connect(self):
self.conn.create_aggregate('sort_concat', 2, SafeSortedConcatenate)
self.conn.create_collation('PYNOCASE', partial(pynocase,
encoding=encoding))
if tweaks['title_series_sorting'] == 'strictly_alphabetic':
self.conn.create_function('title_sort', 1, lambda x:x)
else:
self.conn.create_function('title_sort', 1, title_sort)
self.conn.create_function('title_sort', 1, title_sort)
self.conn.create_function('author_to_author_sort', 1,
_author_to_author_sort)
self.conn.create_function('uuid4', 0, lambda : str(uuid.uuid4()))