Merge branch 'Pavuucek-hotfixes' into hotfixes
This commit is contained in:
commit
8c4d00da3d
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@ from Queue import Queue, Empty
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from urllib import quote_plus, unquote
|
from urllib import quote_plus, unquote
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
from os import makedirs
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from xbmc import sleep, translatePath
|
from xbmc import sleep, translatePath
|
||||||
|
@ -136,6 +137,7 @@ class Artwork():
|
||||||
path = tryDecode(translatePath("special://thumbnails/"))
|
path = tryDecode(translatePath("special://thumbnails/"))
|
||||||
if exists_dir(path):
|
if exists_dir(path):
|
||||||
rmtree(path, ignore_errors=True)
|
rmtree(path, ignore_errors=True)
|
||||||
|
self.restoreCacheDirectories()
|
||||||
|
|
||||||
# remove all existing data from texture DB
|
# remove all existing data from texture DB
|
||||||
connection = kodiSQL('texture')
|
connection = kodiSQL('texture')
|
||||||
|
@ -335,7 +337,14 @@ class Artwork():
|
||||||
LOG.debug("Deleting cached thumbnail: %s" % path)
|
LOG.debug("Deleting cached thumbnail: %s" % path)
|
||||||
if exists(path):
|
if exists(path):
|
||||||
rmtree(tryDecode(path), ignore_errors=True)
|
rmtree(tryDecode(path), ignore_errors=True)
|
||||||
|
self.restoreCacheDirectories()
|
||||||
cursor.execute("DELETE FROM texture WHERE url = ?", (url,))
|
cursor.execute("DELETE FROM texture WHERE url = ?", (url,))
|
||||||
connection.commit()
|
connection.commit()
|
||||||
finally:
|
finally:
|
||||||
connection.close()
|
connection.close()
|
||||||
|
|
||||||
|
def restoreCacheDirectories(self):
|
||||||
|
LOG.info("Restoring cache directories...")
|
||||||
|
paths = ("","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","Video","plex")
|
||||||
|
for p in paths:
|
||||||
|
makedirs(tryDecode(translatePath("special://thumbnails/%s" % p)))
|
||||||
|
|
Loading…
Reference in a new issue