diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-11-05 08:30:02 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-11-05 08:30:02 +0100 |
| commit | a8fd8e5e6c8a56c2e8dcdfbf7927b7e31221fd9a (patch) | |
| tree | 74b93ccdc96f04b4d272d69f084fe3080731f152 /lib/python/Plugins | |
| parent | 7560beb3e371704d798259ca1ea927bf4575306c (diff) | |
| parent | 946a71097573dc8abc273d24efd23bab3e5f2fb2 (diff) | |
| download | enigma2-a8fd8e5e6c8a56c2e8dcdfbf7927b7e31221fd9a.tar.gz enigma2-a8fd8e5e6c8a56c2e8dcdfbf7927b7e31221fd9a.zip | |
Merge branch 'master' into bug_236_recordpath
Diffstat (limited to 'lib/python/Plugins')
| -rwxr-xr-x | lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py | 42 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 2 |
2 files changed, 28 insertions, 16 deletions
diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py b/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py index feb39a95..53287a36 100755 --- a/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py +++ b/lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py @@ -82,7 +82,9 @@ class DVDToolbox(Screen): self.update() def mediainfoCB(self, mediuminfo, retval, extra_args): - capacity = 1 + formatted_capacity = 0 + read_capacity = 0 + capacity = 0 used = 0 infotext = "" mediatype = "" @@ -93,21 +95,17 @@ class DVDToolbox(Screen): self.formattable = True else: self.formattable = False - if line.find("Legacy lead-out at:") > -1: + elif line.find("Legacy lead-out at:") > -1: used = int(line.rsplit('=',1)[1]) / 1048576.0 - print "[lead out] used =", used + print "[dvd+rw-mediainfo] lead out used =", used elif line.find("formatted:") > -1: - capacity = int(line.rsplit('=',1)[1]) / 1048576.0 - print "[formatted] capacity =", capacity - elif capacity == 1 and line.find("READ CAPACITY:") > -1: - capacity = int(line.rsplit('=',1)[1]) / 1048576.0 - print "[READ CAP] capacity =", capacity - elif line.find("Disc status:") > -1: - if line.find("blank") > -1: - print "[Disc status] capacity=%d, used=0" % (capacity) - capacity = used - used = 0 - elif line.find("Free Blocks:") > -1: + formatted_capacity = int(line.rsplit('=',1)[1]) / 1048576.0 + print "[dvd+rw-mediainfo] formatted capacity =", formatted_capacity + elif formatted_capacity == 0 and line.find("READ CAPACITY:") > -1: + read_capacity = int(line.rsplit('=',1)[1]) / 1048576.0 + print "[dvd+rw-mediainfo] READ CAPACITY =", read_capacity + for line in mediuminfo.splitlines(): + if line.find("Free Blocks:") > -1: try: size = eval(line[14:].replace("KB","*1024")) except: @@ -116,8 +114,22 @@ class DVDToolbox(Screen): capacity = size / 1048576 if used: used = capacity-used - print "[free blocks] capacity=%d, used=%d" % (capacity, used) + print "[dvd+rw-mediainfo] free blocks capacity=%d, used=%d" % (capacity, used) + elif line.find("Disc status:") > -1: + if line.find("blank") > -1: + print "[dvd+rw-mediainfo] Disc status blank capacity=%d, used=0" % (capacity) + capacity = used + used = 0 + elif line.find("complete") > -1 and formatted_capacity == 0: + print "[dvd+rw-mediainfo] Disc status complete capacity=0, used=%d" % (capacity) + used = read_capacity + capacity = 1 + else: + capacity = formatted_capacity infotext += line+'\n' + if capacity and used > capacity: + used = read_capacity or capacity + capacity = formatted_capacity or capacity self["details"].setText(infotext) if self.formattable: self["key_yellow"].text = _("Format") diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 596f2d5a..0e3bdf02 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -110,7 +110,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB # 'None' is magic to start at the list of mountpoints defaultDir = config.mediaplayer.defaultDir.getValue() - self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") + self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls") self["filelist"] = self.filelist self.playlist = MyPlayList() |
