Optimize code
This commit is contained in:
parent
818f370c46
commit
1a77427591
1 changed files with 2 additions and 8 deletions
|
@ -310,15 +310,9 @@ class Artwork():
|
||||||
self.cacheTexture(imageUrl)
|
self.cacheTexture(imageUrl)
|
||||||
|
|
||||||
def deleteArtwork(self, kodiId, mediaType, cursor):
|
def deleteArtwork(self, kodiId, mediaType, cursor):
|
||||||
query = ' '.join((
|
query = 'SELECT url FROM art WHERE media_id = ? AND media_type = ?'
|
||||||
"SELECT url",
|
|
||||||
"FROM art",
|
|
||||||
"WHERE media_id = ?",
|
|
||||||
"AND media_type = ?"
|
|
||||||
))
|
|
||||||
cursor.execute(query, (kodiId, mediaType,))
|
cursor.execute(query, (kodiId, mediaType,))
|
||||||
rows = cursor.fetchall()
|
for row in cursor.fetchall():
|
||||||
for row in rows:
|
|
||||||
self.deleteCachedArtwork(row[0])
|
self.deleteCachedArtwork(row[0])
|
||||||
|
|
||||||
def deleteCachedArtwork(self, url):
|
def deleteCachedArtwork(self, url):
|
||||||
|
|
Loading…
Reference in a new issue