Fix possible OperationalErrors

This commit is contained in:
tomkat83 2017-05-12 13:25:46 +02:00
parent f83a304419
commit 7d6310601c
2 changed files with 3 additions and 4 deletions

View file

@ -236,8 +236,7 @@ class Artwork():
for row in rows:
tableName = row[0]
if tableName != "version":
query = "DELETE FROM ?"
cursor.execute(query, (tableName,))
cursor.execute("DELETE FROM %s" % tableName)
connection.commit()
connection.close()

View file

@ -1409,8 +1409,8 @@ class Kodidb_Functions():
ID = 'idEpisode'
elif kodi_type == v.KODI_TYPE_SONG:
ID = 'idSong'
query = '''UPDATE ? SET userrating = ? WHERE ? = ?'''
self.cursor.execute(query, (kodi_type, userrating, ID, kodi_id))
query = '''UPDATE %s SET userrating = ? WHERE ? = ?''' % kodi_type
self.cursor.execute(query, (userrating, ID, kodi_id))
def create_entry_uniqueid(self):
self.cursor.execute(