Kill sync threads if library gets suspended
- E.g. user switch
This commit is contained in:
parent
53e7fa3cea
commit
55cbf5824d
2 changed files with 5 additions and 6 deletions
|
@ -83,6 +83,8 @@ class Items(object):
|
||||||
heading=self.addonName,
|
heading=self.addonName,
|
||||||
line1=string(39031) + url,
|
line1=string(39031) + url,
|
||||||
line2=string(39032))
|
line2=string(39032))
|
||||||
|
if resp:
|
||||||
|
utils.window('suspend_LibraryThread', value="true")
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def itemsbyId(self, items, process, pdialog=None):
|
def itemsbyId(self, items, process, pdialog=None):
|
||||||
|
@ -1051,7 +1053,6 @@ class TVShows(Items):
|
||||||
not xbmcvfs.exists(path.encode('utf-8'))):
|
not xbmcvfs.exists(path.encode('utf-8'))):
|
||||||
# Validate the path is correct with user intervention
|
# Validate the path is correct with user intervention
|
||||||
if self.askToValidate(playurl):
|
if self.askToValidate(playurl):
|
||||||
utils.window('emby_shouldStop', value="true")
|
|
||||||
return False
|
return False
|
||||||
utils.window('emby_pathverified', value="true")
|
utils.window('emby_pathverified', value="true")
|
||||||
if doIndirect:
|
if doIndirect:
|
||||||
|
@ -1334,7 +1335,6 @@ class TVShows(Items):
|
||||||
not xbmcvfs.exists(playurl.encode('utf-8'))):
|
not xbmcvfs.exists(playurl.encode('utf-8'))):
|
||||||
# Validate the path is correct with user intervention
|
# Validate the path is correct with user intervention
|
||||||
if self.askToValidate(playurl):
|
if self.askToValidate(playurl):
|
||||||
utils.window('emby_shouldStop', value="true")
|
|
||||||
return False
|
return False
|
||||||
if "\\" in playurl:
|
if "\\" in playurl:
|
||||||
# Local path
|
# Local path
|
||||||
|
@ -2086,7 +2086,6 @@ class Music(Items):
|
||||||
not xbmcvfs.exists(playurl.encode('utf-8'))):
|
not xbmcvfs.exists(playurl.encode('utf-8'))):
|
||||||
# Validate the path is correct with user intervention
|
# Validate the path is correct with user intervention
|
||||||
if self.askToValidate(playurl):
|
if self.askToValidate(playurl):
|
||||||
utils.window('emby_shouldStop', value="true")
|
|
||||||
return False
|
return False
|
||||||
if "\\" in playurl:
|
if "\\" in playurl:
|
||||||
# Local path
|
# Local path
|
||||||
|
|
|
@ -27,7 +27,7 @@ import PlexAPI
|
||||||
|
|
||||||
|
|
||||||
@utils.logging
|
@utils.logging
|
||||||
@utils.ThreadMethodsAdditionalStop('emby_shouldStop')
|
@utils.ThreadMethodsAdditionalStop('suspend_LibraryThread')
|
||||||
@utils.ThreadMethods
|
@utils.ThreadMethods
|
||||||
class ThreadedGetMetadata(Thread):
|
class ThreadedGetMetadata(Thread):
|
||||||
"""
|
"""
|
||||||
|
@ -114,7 +114,7 @@ class ThreadedGetMetadata(Thread):
|
||||||
self.terminateNow()
|
self.terminateNow()
|
||||||
|
|
||||||
|
|
||||||
@utils.ThreadMethodsAdditionalStop('emby_shouldStop')
|
@utils.ThreadMethodsAdditionalStop('suspend_LibraryThread')
|
||||||
@utils.ThreadMethods
|
@utils.ThreadMethods
|
||||||
class ThreadedProcessMetadata(Thread):
|
class ThreadedProcessMetadata(Thread):
|
||||||
"""
|
"""
|
||||||
|
@ -186,7 +186,7 @@ class ThreadedProcessMetadata(Thread):
|
||||||
self.terminateNow()
|
self.terminateNow()
|
||||||
|
|
||||||
|
|
||||||
@utils.ThreadMethodsAdditionalStop('emby_shouldStop')
|
@utils.ThreadMethodsAdditionalStop('suspend_LibraryThread')
|
||||||
@utils.ThreadMethods
|
@utils.ThreadMethods
|
||||||
class ThreadedShowSyncInfo(Thread):
|
class ThreadedShowSyncInfo(Thread):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue