From 36c78b0d6e3b062026f2ced42ccbb44d8818f360 Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 23 Feb 2019 08:53:37 +0100 Subject: [PATCH] Fix PKC trying to initialize playqueues over and over again --- resources/lib/playqueue.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 3d35a983..929ccc75 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -5,6 +5,8 @@ Monitors the Kodi playqueue and adjusts the Plex playqueue accordingly """ from __future__ import absolute_import, division, unicode_literals from logging import getLogger +import copy + import xbmc from .plex_api import API @@ -97,11 +99,14 @@ class PlayqueueMonitor(backgroundthread.KillableThread): (playlist) are swapped. This is what this monitor is for. Don't replace this mechanism till Kodi's implementation of playlists has improved """ - def _compare_playqueues(self, playqueue, new): + def _compare_playqueues(self, playqueue, new_kodi_playqueue): """ Used to poll the Kodi playqueue and update the Plex playqueue if needed """ old = list(playqueue.items) + # We might append to new_kodi_playqueue but will need the original + # still back in the main loop + new = copy.deepcopy(new_kodi_playqueue) index = list(range(0, len(old))) LOG.debug('Comparing new Kodi playqueue %s with our play queue %s', new, old)