Mediaplayer: don't crash if writing playlist.e2pls fails
authorFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 5 Oct 2009 18:24:17 +0000 (20:24 +0200)
committerFraxinas <andreas.frisch@multimedia-labs.de>
Mon, 5 Oct 2009 18:24:17 +0000 (20:24 +0200)
lib/python/Plugins/Extensions/MediaPlayer/plugin.py

index c535e1b..596f2d5 100644 (file)
@@ -241,7 +241,10 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                for x in self.playlist.list:
                        self.playlistIOInternal.addService(ServiceReference(x[0]))
                if self.savePlaylistOnExit:
                for x in self.playlist.list:
                        self.playlistIOInternal.addService(ServiceReference(x[0]))
                if self.savePlaylistOnExit:
-                       self.playlistIOInternal.save(resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
+                       try:
+                               self.playlistIOInternal.save(resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
+                       except IOError:
+                               print "couldn't save playlist.e2pls"
                if config.mediaplayer.saveDirOnExit.getValue():
                        config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
                        config.mediaplayer.defaultDir.save()
                if config.mediaplayer.saveDirOnExit.getValue():
                        config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
                        config.mediaplayer.defaultDir.save()