fall back to CDServer.sqlite if cdclient.sqlite doesn't exist
This commit is contained in:
aronwk-aaron 2022-11-28 13:17:26 -06:00
parent e69d25594a
commit ba157a3715

View File

@ -191,9 +191,18 @@ def get_cdclient():
""" """
cdclient = getattr(g, '_cdclient', None) cdclient = getattr(g, '_cdclient', None)
if cdclient is None: if cdclient is None:
path = pathlib.Path('app/luclient/res/cdclient.sqlite')
if path.is_file():
cdclient = g._database = sqlite3.connect('app/luclient/res/cdclient.sqlite') cdclient = g._database = sqlite3.connect('app/luclient/res/cdclient.sqlite')
return cdclient return cdclient
path = pathlib.Path('app/luclient/res/CDServer.sqlite')
if path.is_file():
cdclient = g._database = sqlite3.connect('app/luclient/res/CDServer.sqlite')
return cdclient
return cdclient
def query_cdclient(query, args=(), one=False): def query_cdclient(query, args=(), one=False):
"""Run sql queries on CDClient """Run sql queries on CDClient