Adjust playlist props

Instead of using clearProperties, clear individually.
This commit is contained in:
angelblue05 2016-01-18 21:54:02 -06:00
parent f3f8c76197
commit d14ecfdc5e
5 changed files with 11 additions and 12 deletions

View File

@ -200,5 +200,5 @@ class KodiMonitor(xbmc.Monitor):
utils.window('emby_onWake', value="true") utils.window('emby_onWake', value="true")
elif method == "Playlist.OnClear": elif method == "Playlist.OnClear":
utils.window('emby_customPlaylist', clear=True, windowid=10008) utils.window('emby_customPlaylist', clear=True)
self.logMsg("Clear playlist properties.") self.logMsg("Clear playlist properties.")

View File

@ -74,7 +74,7 @@ class PlaybackUtils():
sizePlaylist = playlist.size() sizePlaylist = playlist.size()
currentPosition = startPos currentPosition = startPos
propertiesPlayback = utils.window('emby_playbackProps', windowid=10008) == "true" propertiesPlayback = utils.window('emby_playbackProps') == "true"
introsPlaylist = False introsPlaylist = False
dummyPlaylist = False dummyPlaylist = False
@ -91,11 +91,11 @@ class PlaybackUtils():
# Otherwise we get a loop. # Otherwise we get a loop.
if not propertiesPlayback: if not propertiesPlayback:
utils.window('emby_playbackProps', value="true", windowid=10008) utils.window('emby_playbackProps', value="true")
self.logMsg("Setting up properties in playlist.", 1) self.logMsg("Setting up properties in playlist.", 1)
if (not homeScreen and not seektime and if (not homeScreen and not seektime and
utils.window('emby_customPlaylist', windowid=10008) != "true"): utils.window('emby_customPlaylist') != "true"):
self.logMsg("Adding dummy file to playlist.", 2) self.logMsg("Adding dummy file to playlist.", 2)
dummyPlaylist = True dummyPlaylist = True
@ -182,7 +182,7 @@ class PlaybackUtils():
# We just skipped adding properties. Reset flag for next time. # We just skipped adding properties. Reset flag for next time.
elif propertiesPlayback: elif propertiesPlayback:
self.logMsg("Resetting properties playback flag.", 2) self.logMsg("Resetting properties playback flag.", 2)
utils.window('emby_playbackProps', clear=True, windowid=10008) utils.window('emby_playbackProps', clear=True)
#self.pl.verifyPlaylist() #self.pl.verifyPlaylist()
########## SETUP MAIN ITEM ########## ########## SETUP MAIN ITEM ##########
@ -202,7 +202,7 @@ class PlaybackUtils():
self.setListItem(listitem) self.setListItem(listitem)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
elif ((introsPlaylist and utils.window('emby_customPlaylist', windowid=10008) == "true") or elif ((introsPlaylist and utils.window('emby_customPlaylist') == "true") or
(homeScreen and not sizePlaylist)): (homeScreen and not sizePlaylist)):
# Playlist was created just now, play it. # Playlist was created just now, play it.
self.logMsg("Play playlist.", 1) self.logMsg("Play playlist.", 1)

View File

@ -400,8 +400,9 @@ class Player(xbmc.Player):
def onPlayBackStopped( self ): def onPlayBackStopped( self ):
# Will be called when user stops xbmc playing a file # Will be called when user stops xbmc playing a file
self.logMsg("ONPLAYBACK_STOPPED", 2) self.logMsg("ONPLAYBACK_STOPPED", 2)
xbmcgui.Window(10008).clearProperties() utils.window('emby_customPlaylist', clear=True)
self.logMsg("Clear playlist properties.") utils.window('emby_playbackProps', clear=True)
self.logMsg("Clear playlist properties.", 1)
self.stopAll() self.stopAll()
def onPlayBackEnded( self ): def onPlayBackEnded( self ):

View File

@ -51,7 +51,7 @@ class Playlist():
playlist.clear() playlist.clear()
started = False started = False
utils.window('emby_customplaylist', value="true", windowid=10008) utils.window('emby_customplaylist', value="true")
position = 0 position = 0

View File

@ -71,13 +71,11 @@ class Service():
"emby_online", "emby_serverStatus", "emby_onWake", "emby_online", "emby_serverStatus", "emby_onWake",
"emby_syncRunning", "emby_dbCheck", "emby_kodiScan", "emby_syncRunning", "emby_dbCheck", "emby_kodiScan",
"emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId", "emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId",
"emby_initialScan" "emby_initialScan", "emby_customplaylist", "emby_playbackProps"
] ]
for prop in properties: for prop in properties:
utils.window(prop, clear=True) utils.window(prop, clear=True)
# Clear playlist properties
xbmcgui.Window(10008).clearProperties()
# Clear video nodes properties # Clear video nodes properties
videonodes.VideoNodes().clearProperties() videonodes.VideoNodes().clearProperties()