Don't add media by other add-ons to queue

- Fixes #295
This commit is contained in:
tomkat83 2017-05-11 19:58:21 +02:00
parent 9138cdbb67
commit 5c8c399b30
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ log = logging.getLogger("PLEX."+__name__)
# Lock used for playqueue manipulations
lock = RLock()
PLUGIN = 'plugin://%s' % v.ADDON_ID
###############################################################################
@ -147,11 +148,19 @@ class Playqueue(Thread):
log.debug('Comparing new Kodi playqueue %s with our play queue %s'
% (new, old))
for i, new_item in enumerate(new):
if (new_item['file'].startswith('plugin://') and
not new_item['file'].startswith(PLUGIN)):
# Ignore new media added by other addons
continue
for j, old_item in enumerate(old):
if self.threadStopped():
# Chances are that we got an empty Kodi playlist due to
# Kodi exit
return
if (old_item['file'].startswith('plugin://') and
not old_item['file'].startswith(PLUGIN)):
# Ignore media by other addons
continue
if new_item.get('id') is None:
identical = old_item.file == new_item['file']
else: