From d636271525484a4cd3180a3eca4d7320de1b333a Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 19 Aug 2017 13:42:15 +0200 Subject: [PATCH] Don't show sync progress if media is playing --- resources/lib/library_sync/sync_info.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/library_sync/sync_info.py b/resources/lib/library_sync/sync_info.py index 86c21a75..37bbaa21 100644 --- a/resources/lib/library_sync/sync_info.py +++ b/resources/lib/library_sync/sync_info.py @@ -2,7 +2,7 @@ from logging import getLogger from threading import Thread, Lock -from xbmc import sleep +from xbmc import sleep, Player from xbmcgui import DialogProgressBG from utils import thread_methods, language as lang @@ -55,10 +55,11 @@ class Threaded_Show_Sync_Info(Thread): thread_stopped = self.thread_stopped dialog.create("%s %s: %s %s" % (lang(39714), self.item_type, str(total), lang(39715))) + player = Player() total = 2 * total totalProgress = 0 - while thread_stopped() is False: + while thread_stopped() is False and not player.isPlaying(): with LOCK: get_progress = GET_METADATA_COUNT process_progress = PROCESS_METADATA_COUNT