nastily pretend the dvd minus rw bruning error never happened
authorFraxinas <andreas.frisch@multimedia-labs.de>
Wed, 5 Nov 2008 11:52:46 +0000 (12:52 +0100)
committerAndreas Oberritter <obi@saftware.de>
Thu, 6 Nov 2008 00:52:05 +0000 (01:52 +0100)
lib/python/Plugins/Extensions/DVDBurn/Process.py

index 7a03b7ebd68cdf8c9f54d8ba442f199282f1d6c9..9cca8f706c3a357f4e4f37a89b9b0dd46bc41607 100644 (file)
@@ -241,7 +241,11 @@ class WaitForResidentTasks(Task):
 class BurnTaskPostcondition(Condition):
        RECOVERABLE = True
        def check(self, task):
-               return task.error is None
+               if task.returncode == 0:
+                       return True
+               elif task.error is None or task.error is task.ERROR_MINUSRWBUG:
+                       return True
+               return False
 
        def getErrorMessage(self, task):
                return {
@@ -257,7 +261,7 @@ class BurnTaskPostcondition(Condition):
                }[task.error]
 
 class BurnTask(Task):
-       ERROR_NOTWRITEABLE, ERROR_LOAD, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_ISOFS, ERROR_FILETOOLARGE, ERROR_ISOTOOLARGE, ERROR_UNKNOWN = range(9)
+       ERROR_NOTWRITEABLE, ERROR_LOAD, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_ISOFS, ERROR_FILETOOLARGE, ERROR_ISOTOOLARGE, ERROR_MINUSRWBUG, ERROR_UNKNOWN = range(10)
        def __init__(self, job, extra_args=[], tool="/bin/growisofs"):
                Task.__init__(self, job, job.name)
                self.weighting = 500
@@ -284,12 +288,17 @@ class BurnTask(Task):
                                self.error = self.ERROR_NOTWRITEABLE
                        if line.find("ASC=24h") != -1:
                                self.error = self.ERROR_LOAD
+                       if line.find("SK=5h/ASC=A8h/ACQ=04h") != -1:
+                               self.error = self.ERROR_MINUSRWBUG
                        else:
                                self.error = self.ERROR_UNKNOWN
                                print "BurnTask: unknown error %s" % line
                elif line.startswith(":-("):
                        if line.find("No space left on device") != -1:
                                self.error = self.ERROR_SIZE
+                       elif self.error == self.ERROR_MINUSRWBUG:
+                               print "*sigh* this is a known bug. we're simply gonna assume everything is fine."
+                               self.postconditions = []
                        elif line.find("write failed") != -1:
                                self.error = self.ERROR_WRITE_FAILED
                        elif line.find("unable to open64(") != -1 and line.find(",O_RDONLY): No such file or directory") != -1:
@@ -309,6 +318,11 @@ class BurnTask(Task):
                        self.error = self.ERROR_FILETOOLARGE
                elif line.startswith("genisoimage: File too large."):
                        self.error = self.ERROR_ISOTOOLARGE
+       
+       def setTool(self, tool):
+               self.cmd = tool
+               self.args = [tool]
+               self.global_preconditions.append(ToolExistsPrecondition())
 
 class RemoveDVDFolder(Task):
        def __init__(self, job):