Optimize code

This commit is contained in:
croneter 2018-02-25 18:06:33 +01:00
parent 818f370c46
commit 1a77427591

View file

@ -310,15 +310,9 @@ class Artwork():
self.cacheTexture(imageUrl)
def deleteArtwork(self, kodiId, mediaType, cursor):
query = ' '.join((
"SELECT url",
"FROM art",
"WHERE media_id = ?",
"AND media_type = ?"
))
query = 'SELECT url FROM art WHERE media_id = ? AND media_type = ?'
cursor.execute(query, (kodiId, mediaType,))
rows = cursor.fetchall()
for row in rows:
for row in cursor.fetchall():
self.deleteCachedArtwork(row[0])
def deleteCachedArtwork(self, url):