Never show library sync dialog if media is playing

This commit is contained in:
croneter 2017-08-18 10:56:45 +02:00
parent 1aee66a565
commit b544ad93f3

View file

@ -62,6 +62,7 @@ class LibrarySync(Thread):
self.user = userclient.UserClient() self.user = userclient.UserClient()
self.vnodes = videonodes.VideoNodes() self.vnodes = videonodes.VideoNodes()
self.xbmcplayer = xbmc.Player()
self.syncThreadNumber = int(settings('syncThreadNumber')) self.syncThreadNumber = int(settings('syncThreadNumber'))
self.installSyncDone = settings('SyncInstallRunDone') == 'true' self.installSyncDone = settings('SyncInstallRunDone') == 'true'
@ -92,6 +93,9 @@ class LibrarySync(Thread):
forced: always show popup, even if user setting to off forced: always show popup, even if user setting to off
""" """
if self.xbmcplayer.isPlaying():
# Don't show any dialog if media is playing
return
if settings('dbSyncIndicator') != 'true': if settings('dbSyncIndicator') != 'true':
if not forced: if not forced:
return return
@ -1413,8 +1417,6 @@ class LibrarySync(Thread):
lastProcessing = 0 lastProcessing = 0
oneDay = 60*60*24 oneDay = 60*60*24
xbmcplayer = xbmc.Player()
# Link to Websocket queue # Link to Websocket queue
queue = self.mgr.ws.queue queue = self.mgr.ws.queue
@ -1584,7 +1586,7 @@ class LibrarySync(Thread):
else: else:
now = getUnixTimestamp() now = getUnixTimestamp()
if (now - lastSync > fullSyncInterval and if (now - lastSync > fullSyncInterval and
not xbmcplayer.isPlaying()): not self.xbmcplayer.isPlaying()):
lastSync = now lastSync = now
log.info('Doing scheduled full library scan') log.info('Doing scheduled full library scan')
state.DB_SCAN = True state.DB_SCAN = True