From 1a774275917aeb96b9073d97118645ee0fd3643e Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 25 Feb 2018 18:06:33 +0100 Subject: [PATCH] Optimize code --- resources/lib/artwork.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index 0565b7b7..ee626508 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -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):