From: Fraxinas Date: Wed, 29 Jul 2009 12:08:29 +0000 (+0200) Subject: fix disc size unit confusion X-Git-Tag: 2.6.0~172^2 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/ed817937df0a68c0b222a4e48fdf24984d87c2fb fix disc size unit confusion --- diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py index 9a3bd64c..83672460 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py +++ b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py @@ -18,8 +18,8 @@ class ConfigFilename(ConfigText): return ("mtext"[1-selected:], filename, mark) class DVDProject: - MAX_SL = 4370 - MAX_DL = 7950 + MAX_SL = 4480 + MAX_DL = 8150 def __init__(self): self.titles = [ ] self.target = None diff --git a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py index aeb163f3..83bafd74 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/TitleList.py +++ b/lib/python/Plugins/Extensions/DVDBurn/TitleList.py @@ -245,21 +245,24 @@ class TitleList(Screen, HelpableScreen): self["key_yellow"].text = "" def updateSize(self): - size = self.project.size - if size > self.project.MAX_DL: - percent = 100 * size / float(self.project.MAX_DL) + size = self.project.size/(1024*1024) + MAX_DL = self.project.MAX_DL-100 + MAX_SL = self.project.MAX_SL-100 + print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL + if size > MAX_DL: + percent = 100 * size / float(MAX_DL) self["space_label"].text = "%d MB - " % size + _("exceeds dual layer medium!") + " (%.2f%% " % (100-percent) + _("free") + ")" self["space_bar"].value = int(percent) - if self.previous_size < self.project.MAX_DL: + if self.previous_size < MAX_DL: self.session.open(MessageBox,text = _("exceeds dual layer medium!"), type = MessageBox.TYPE_ERROR) - elif size > self.project.MAX_SL: - percent = 100 * size / float(self.project.MAX_DL) + elif size > MAX_SL: + percent = 100 * size / float(MAX_DL) self["space_label"].text = "%d MB " % size + _("of a DUAL layer medium used.") + " (%.2f%% " % (100-percent) + _("free") + ")" self["space_bar"].value = int(percent) - if self.previous_size < self.project.MAX_SL: + if self.previous_size < MAX_SL: self.session.open(MessageBox,text = _("Your collection exceeds the size of a single layer medium, you will need a blank dual layer DVD!"), type = MessageBox.TYPE_INFO) - elif size < self.project.MAX_SL: - percent = 100 * size / float(self.project.MAX_SL) + elif size < MAX_SL: + percent = 100 * size / float(MAX_SL) self["space_label"].text = "%d MB " % size + _("of a SINGLE layer medium used.") + " (%.2f%% " % (100-percent) + _("free") + ")" self["space_bar"].value = int(percent) self.previous_size = size