diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-27 20:27:13 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-27 20:27:13 +0000 |
| commit | 9a678498c312c304363ef3318ffbe9b0c4def740 (patch) | |
| tree | 38a09acf92da5bf367e43811807702fa3936dd9c /lib/python | |
| parent | b019cafee73ac7e9b06d2f9ee03913cb7b57f9a2 (diff) | |
| download | enigma2-9a678498c312c304363ef3318ffbe9b0c4def740.tar.gz enigma2-9a678498c312c304363ef3318ffbe9b0c4def740.zip | |
to prevent bsods stop currently playing file, when remove it from playlist
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/MediaPlayer.py | 10 | ||||
| -rw-r--r-- | lib/python/Screens/MediaPlayer.py | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index 31799c5b..31406e49 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -63,7 +63,9 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): def clear(self): self.list = [] self.l.setList(self.list) - + self.currPlaying = 0 + self.oldCurrPlaying = -1 + def GUIcreate(self, parent): self.instance = eListbox(parent) self.instance.setContent(self.l) @@ -81,8 +83,8 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): def deleteFile(self, index): if self.currPlaying >= index: self.currPlaying -= 1 - self.list = self.list[:index] + self.list[index + 1:] - + del self.list[index] + def setCurrentPlaying(self, index): self.oldCurrPlaying = self.currPlaying self.currPlaying = index @@ -121,4 +123,4 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): return list def __len__(self): - return len(self.list)
\ No newline at end of file + return len(self.list) diff --git a/lib/python/Screens/MediaPlayer.py b/lib/python/Screens/MediaPlayer.py index dddf5f50..21f26ffa 100644 --- a/lib/python/Screens/MediaPlayer.py +++ b/lib/python/Screens/MediaPlayer.py @@ -278,6 +278,8 @@ class MediaPlayer(Screen, InfoBarSeek): elif choice[1] == "filelist": self.switchToFileList() elif choice[1] == "delete": + if self.playlist.getSelectionIndex() == self.playlist.getCurrentIndex(): + self.stopEntry() self.deleteEntry() elif choice[1] == "clear": self.stopEntry() @@ -356,5 +358,6 @@ class MediaPlayer(Screen, InfoBarSeek): def stopEntry(self): self.playlist.stopFile() self.session.nav.playService(None) + self.updateMusicInformation(clear=True) |
