mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 10:46:11 +00:00
close con when needed
This commit is contained in:
parent
cdd6239736
commit
6997c7f79a
1 changed files with 5 additions and 0 deletions
|
@ -49,8 +49,13 @@ class ReadKodiDB():
|
||||||
if not connection:
|
if not connection:
|
||||||
connection = utils.KodiSQL()
|
connection = utils.KodiSQL()
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
|
closeCon = True
|
||||||
|
else:
|
||||||
|
closeCon = False
|
||||||
cursor.execute("SELECT emby_id FROM emby WHERE media_type=? AND kodi_id=?",(type,id))
|
cursor.execute("SELECT emby_id FROM emby WHERE media_type=? AND kodi_id=?",(type,id))
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
|
if closeCon:
|
||||||
|
connection.close()
|
||||||
if result:
|
if result:
|
||||||
return result[0]
|
return result[0]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue