Don't let PMS crash: download one item at a time

- PMS can currently not handle concurrent connections asking for
metadata (several PKC threads)
- Might also fix #75
This commit is contained in:
tomkat83 2016-07-17 13:57:50 +02:00
parent fcf6dce7d4
commit 8a2fdec248
3 changed files with 9 additions and 14 deletions

View file

@ -18,9 +18,7 @@ I'm not in any way affiliated with Plex. Thank you very much for a small donatio
### IMPORTANT NOTES ### IMPORTANT NOTES
1. If your are using a **low CPU device like a raspberry pi or a CuBox**, PKC might be instable or crash during initial sync. Lower the number of threads in the [PKC settings under Sync Options](https://github.com/croneter/PlexKodiConnect/wiki/PKC-settings#sync-options): 1. If your are using a **low CPU device like a raspberry pi or a CuBox**, PKC might be instable or crash during initial sync. Lower the number of threads in the [PKC settings under Sync Options](https://github.com/croneter/PlexKodiConnect/wiki/PKC-settings#sync-options): `Limit artwork cache threads: 5`
- Limit artwork cache threads: 5
- Limit download sync threads: 1
Don't forget to reboot Kodi after that. Don't forget to reboot Kodi after that.
2. If you post logs, your **Plex tokens** might be included. Be sure to double and tripple check for tokens before posting any logs anywhere by searching for `token` 2. If you post logs, your **Plex tokens** might be included. Be sure to double and tripple check for tokens before posting any logs anywhere by searching for `token`
3. **Compatibility**: PKC is currently not compatible with Kodi's Video Extras plugin. **Deactivate Video Extras** if trailers/movies start randomly playing. 3. **Compatibility**: PKC is currently not compatible with Kodi's Video Extras plugin. **Deactivate Video Extras** if trailers/movies start randomly playing.

View file

@ -287,7 +287,6 @@ class LibrarySync(Thread):
self.vnodes = videonodes.VideoNodes() self.vnodes = videonodes.VideoNodes()
self.dialog = xbmcgui.Dialog() self.dialog = xbmcgui.Dialog()
self.syncThreadNumber = int(utils.settings('syncThreadNumber'))
self.installSyncDone = True if \ self.installSyncDone = True if \
utils.settings('SyncInstallRunDone') == 'true' else False utils.settings('SyncInstallRunDone') == 'true' else False
self.showDbSync = True if \ self.showDbSync = True if \
@ -846,16 +845,15 @@ class LibrarySync(Thread):
# Populate queue: GetMetadata # Populate queue: GetMetadata
for updateItem in self.updatelist: for updateItem in self.updatelist:
getMetadataQueue.put(updateItem) getMetadataQueue.put(updateItem)
# Spawn GetMetadata threads for downloading # Spawn GetMetadata thread for downloading
threads = [] threads = []
for i in range(min(self.syncThreadNumber, itemNumber)): thread = ThreadedGetMetadata(getMetadataQueue,
thread = ThreadedGetMetadata(getMetadataQueue, processMetadataQueue,
processMetadataQueue, getMetadataLock,
getMetadataLock, processMetadataLock)
processMetadataLock) thread.setDaemon(True)
thread.setDaemon(True) thread.start()
thread.start() threads.append(thread)
threads.append(thread)
self.logMsg("%s download threads spawned" % len(threads), 1) self.logMsg("%s download threads spawned" % len(threads), 1)
# Spawn one more thread to process Metadata, once downloaded # Spawn one more thread to process Metadata, once downloaded
thread = ThreadedProcessMetadata(processMetadataQueue, thread = ThreadedProcessMetadata(processMetadataQueue,

View file

@ -40,7 +40,6 @@
<setting id="limitindex" type="number" label="30515" default="200" option="int" /><!-- Maximum items to request from the server at once --> <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="enableTextureCache" label="30512" type="bool" default="true" /> <!-- Force Artwork Caching -->
<setting id="imageCacheLimit" type="enum" label="30513" values="Disabled|5|10|15|20|25" default="5" visible="eq(-1,true)" subsetting="true" /> <!-- Limit artwork cache threads --> <setting id="imageCacheLimit" type="enum" label="30513" values="Disabled|5|10|15|20|25" default="5" visible="eq(-1,true)" subsetting="true" /> <!-- Limit artwork cache threads -->
<setting id="syncThreadNumber" type="slider" label="39003" default="5" option="int" range="1,1,20"/>
<setting id="serverSync" type="bool" label="30514" default="true" visible="false"/><!-- Enable fast startup (requires server plugin) --> <setting id="serverSync" type="bool" label="30514" default="true" visible="false"/><!-- Enable fast startup (requires server plugin) -->
<setting type="lsep" label="39052" /><!-- Background Sync --> <setting type="lsep" label="39052" /><!-- Background Sync -->