fix disc size unit confusion
authorFraxinas <andreas.frisch@multimedia-labs.de>
Wed, 29 Jul 2009 12:08:29 +0000 (14:08 +0200)
committerFraxinas <andreas.frisch@multimedia-labs.de>
Wed, 29 Jul 2009 12:08:29 +0000 (14:08 +0200)
lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
lib/python/Plugins/Extensions/DVDBurn/TitleList.py

index 9a3bd64c6895707cb384c42bb60aa3bfa4a2a54e..83672460056de935db064aa5c72ccfe17022ed61 100644 (file)
@@ -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
index aeb163f321265d68200556d3c2ac8f71b0cf325e..83bafd747efdf00721eae344383f8ae6ed722c4c 100644 (file)
@@ -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