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:]
|
title = title[1:]
|
||||||
match = _title_pat.search(title)
|
match = _title_pat.search(title)
|
||||||
if match:
|
if match:
|
||||||
prep = match.group(1)
|
try:
|
||||||
title = title[len(prep):] + ', ' + prep
|
prep = match.group(1)
|
||||||
if title[0] in _ignore_starts:
|
except IndexError:
|
||||||
title = title[1:]
|
pass
|
||||||
|
else:
|
||||||
|
title = title[len(prep):] + ', ' + prep
|
||||||
|
if title[0] in _ignore_starts:
|
||||||
|
title = title[1:]
|
||||||
return title.strip()
|
return title.strip()
|
||||||
|
|
||||||
coding = zip(
|
coding = zip(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user