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: for row in rows:
tableName = row[0] tableName = row[0]
if tableName != "version": if tableName != "version":
query = "DELETE FROM ?" cursor.execute("DELETE FROM %s" % tableName)
cursor.execute(query, (tableName,))
connection.commit() connection.commit()
connection.close() connection.close()

View file

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