X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/25b529dd304871c705456047049dd29935f1ffe3..d09071a7547fdff66a2ac20e0ad6bdce0a072ab4:/lib/python/Components/MediaPlayer.py?ds=sidebyside diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index 45551ccc..d88b6280 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -57,13 +57,13 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): self.list = [] self.l.setList(self.list) self.l.setFont(0, gFont("Regular", 18)) - self.currPlaying = 0 + self.currPlaying = -1 self.oldCurrPlaying = -1 def clear(self): del self.list[:] self.l.setList(self.list) - self.currPlaying = 0 + self.currPlaying = -1 self.oldCurrPlaying = -1 GUI_WIDGET = eListbox @@ -93,7 +93,8 @@ class PlayList(MenuList, HTMLComponent, GUIComponent): def updateState(self, state): if len(self.list) > self.oldCurrPlaying and self.oldCurrPlaying != -1: self.list[self.oldCurrPlaying] = PlaylistEntryComponent(self.list[self.oldCurrPlaying][0], STATE_NONE) - self.list[self.currPlaying] = PlaylistEntryComponent(self.list[self.currPlaying][0], state) + if self.currPlaying != -1 and self.currPlaying < len(self.list): + self.list[self.currPlaying] = PlaylistEntryComponent(self.list[self.currPlaying][0], state) self.updateList() def playFile(self):