New setting: sleep between art downloads

This commit is contained in:
tomkat83 2016-09-17 15:39:20 +02:00
parent 1ff7970e88
commit ca3a06affc
4 changed files with 6 additions and 1 deletions

View file

@ -306,6 +306,7 @@
<string id="30540">Download movie set/collection art from FanArtTV</string>
<string id="30541">Don't ask to pick a certain stream/quality</string>
<string id="30542">Always pick best quality for trailers</string>
<string id="30543">Sleep between art downloads [ms]</string>
<!-- service add-on -->

View file

@ -32,6 +32,7 @@
<string id="30540">FanArtTV Film-Sets/Collections Bilder herunterladen</string>
<string id="30541">Nicht fragen, welcher Stream/Qualität gespielt wird</string>
<string id="30542">Trailer immer in der besten Qualität abspielen</string>
<string id="30543">Wartezeit zwischen Bilder downloads [ms]</string>
<string id="30014">Verbindung</string>
<string id="30015">Netzwerk</string>

View file

@ -132,6 +132,7 @@ def double_urldecode(text):
class Image_Cache_Thread(Thread):
xbmc_host = 'localhost'
xbmc_port, xbmc_username, xbmc_password = setKodiWebServerDetails()
sleep_between = int(settings('sleep_between_art_downloads'))
def __init__(self, queue):
self.queue = queue
@ -141,6 +142,7 @@ class Image_Cache_Thread(Thread):
threadStopped = self.threadStopped
threadSuspended = self.threadSuspended
queue = self.queue
sleep_between = self.sleep_between
while not threadStopped():
# In the event the server goes offline
while threadSuspended():
@ -192,7 +194,7 @@ class Image_Cache_Thread(Thread):
queue.task_done()
log.debug('Downloaded art: %s' % double_urldecode(url))
# Sleep for a bit to reduce CPU strain
xbmc.sleep(50)
xbmc.sleep(sleep_between)
log.info("---===### Stopped Image_Cache_Thread ###===---")

View file

@ -39,6 +39,7 @@
<setting type="sep" /><!-- show syncing progress -->
<setting id="limitindex" type="number" label="30515" default="200" option="int" /><!-- Maximum items to request from the server at once -->
<setting id="enableTextureCache" label="30512" type="bool" default="true" /> <!-- Force Artwork Caching -->
<setting id="sleep_between_art_downloads" type="slider" label="30543" default="50" option="int" range="10,10,1000" visible="eq(-1,true)"/>
<setting id="serverSync" type="bool" label="30514" default="true" visible="false"/><!-- Enable fast startup (requires server plugin) -->
<setting type="lsep" label="39052" /><!-- Background Sync -->