mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not error out if there is an invalid regex for title sort set in tweaks
This commit is contained in:
parent
75341b3c99
commit
2532de27fb
@ -116,10 +116,14 @@ def title_sort(title, order=None):
|
||||
title = title[1:]
|
||||
match = _title_pat.search(title)
|
||||
if match:
|
||||
prep = match.group(1)
|
||||
title = title[len(prep):] + ', ' + prep
|
||||
if title[0] in _ignore_starts:
|
||||
title = title[1:]
|
||||
try:
|
||||
prep = match.group(1)
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
title = title[len(prep):] + ', ' + prep
|
||||
if title[0] in _ignore_starts:
|
||||
title = title[1:]
|
||||
return title.strip()
|
||||
|
||||
coding = zip(
|
||||
|
Loading…
x
Reference in New Issue
Block a user