X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6df771b5f7e744c650b73f8548ab41152c0185eb..f46b03d1dd4bf90975b0c946fc2720202832b836:/lib/python/Plugins/Extensions/MediaPlayer/plugin.py diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 485dfe32..e26c65d4 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -224,7 +224,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, - iPlayableService.evUser+11: self.__evDecodeError, + iPlayableService.evUser+10: self.__evAudioDecodeError, + iPlayableService.evUser+11: self.__evVideoDecodeError, iPlayableService.evUser+12: self.__evPluginError, iPlayableService.evUser+13: self["coverArt"].embeddedCoverArt }) @@ -268,11 +269,17 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB print "[__evUpdatedInfo] title %d of %d (%s)" % (currenttitle, totaltitles, sTitle) self.readTitleInformation() - def __evDecodeError(self): + def __evAudioDecodeError(self): + currPlay = self.session.nav.getCurrentService() + sAudioType = currPlay.info().getInfoString(iServiceInformation.sUser+10) + print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sAudioType) + self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sAudioType, type = MessageBox.TYPE_INFO,timeout = 20 ) + + def __evVideoDecodeError(self): currPlay = self.session.nav.getCurrentService() sVideoType = currPlay.info().getInfoString(iServiceInformation.sVideoType) - print "[__evDecodeError] video-codec %s can't be decoded by hardware" % (sVideoType) - self.session.open(MessageBox, _("This Dreambox can't decode %s video streams!") % sVideoType, type = MessageBox.TYPE_INFO,timeout = 20 ) + print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sVideoType) + self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sVideoType, type = MessageBox.TYPE_INFO,timeout = 20 ) def __evPluginError(self): currPlay = self.session.nav.getCurrentService() @@ -659,12 +666,16 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB def copyDirectory(self, directory, recursive = True): print "copyDirectory", directory - filelist = FileList(directory, useServiceRef = True, isTop = True) + if directory == '/': + print "refusing to operate on /" + return + filelist = FileList(directory, useServiceRef = True, showMountpoints = False, isTop = True) for x in filelist.getFileList(): if x[0][1] == True: #isDir if recursive: - self.copyDirectory(x[0][0]) + if x[0][0] != directory: + self.copyDirectory(x[0][0]) elif filelist.getServiceRef() and filelist.getServiceRef().type == 4097: self.playlist.addFile(x[0][0]) self.playlist.updateList() @@ -980,7 +991,7 @@ def filescan(**kwargs): ScanPath(path = "", with_subdirs = False), ], name = "Movie", - description = "View Movies...", + description = _("View Movies..."), openfnc = filescan_open, ), Scanner(mimetypes = ["video/x-vcd"], @@ -990,7 +1001,7 @@ def filescan(**kwargs): ScanPath(path = "MPEGAV", with_subdirs = False), ], name = "Video CD", - description = "View Video CD...", + description = _("View Video CD..."), openfnc = filescan_open, ), Scanner(mimetypes = ["audio/mpeg", "audio/x-wav", "application/ogg", "audio/x-flac"], @@ -999,7 +1010,7 @@ def filescan(**kwargs): ScanPath(path = "", with_subdirs = False), ], name = "Music", - description = "Play Music...", + description = _("Play Music..."), openfnc = filescan_open, )] try: @@ -1011,7 +1022,7 @@ def filescan(**kwargs): ScanPath(path = "", with_subdirs = False), ], name = "Audio-CD", - description = "Play Audio-CD...", + description = _("Play Audio-CD..."), openfnc = audioCD_open, )) return mediatypes