mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16: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:
|
||||
connection = utils.KodiSQL()
|
||||
cursor = connection.cursor()
|
||||
closeCon = True
|
||||
else:
|
||||
closeCon = False
|
||||
cursor.execute("SELECT emby_id FROM emby WHERE media_type=? AND kodi_id=?",(type,id))
|
||||
result = cursor.fetchone()
|
||||
if closeCon:
|
||||
connection.close()
|
||||
if result:
|
||||
return result[0]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue