Fix #2757 (Sqlalchemy >1.30 <1.4.24 wasn't supported anymore)
This commit is contained in:
parent
f2369609e8
commit
fe4dc1bb8f
|
@ -993,7 +993,12 @@ class CalibreDB:
|
|||
title = title[len(prep):] + ', ' + prep
|
||||
return title.strip()
|
||||
|
||||
conn = conn or self.session.connection().connection.driver_connection
|
||||
try:
|
||||
# sqlalchemy <1.4.24
|
||||
conn = conn or self.session.connection().connection.driver_connection
|
||||
except AttributeError:
|
||||
# sqlalchemy >1.4.24 and sqlalchemy 2.0
|
||||
conn = conn or self.session.connection().connection.connection
|
||||
try:
|
||||
conn.create_function("title_sort", 1, _title_sort)
|
||||
except sqliteOperationalError:
|
||||
|
|
Loading…
Reference in New Issue
Block a user