X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ad262aa36156b381d73fc9b85f5e09dc32882989..3c066dfc061d51c59caf201e302cfb2301b5f0f7:/lib/python/Plugins/Extensions/DVDBurn/Process.py diff --git a/lib/python/Plugins/Extensions/DVDBurn/Process.py b/lib/python/Plugins/Extensions/DVDBurn/Process.py index b9710d5a..42af6ca6 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Process.py +++ b/lib/python/Plugins/Extensions/DVDBurn/Process.py @@ -213,11 +213,12 @@ class BurnTaskPostcondition(Condition): task.ERROR_SIZE: ("Content does not fit on DVD!"), task.ERROR_WRITE_FAILED: ("Write failed!"), task.ERROR_DVDROM: ("No (supported) DVDROM found!"), + task.ERROR_ISOFS: ("Medium is not empty!"), task.ERROR_UNKNOWN: ("An unknown error occured!") }[task.error] class BurnTask(Task): - ERROR_MEDIA, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_UNKNOWN = range(5) + ERROR_MEDIA, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_ISOFS, ERROR_UNKNOWN = range(6) def __init__(self, job): Task.__init__(self, job, "burn") @@ -268,6 +269,12 @@ class BurnTask(Task): else: self.error = self.ERROR_UNKNOWN print "BurnTask: unknown error %s" % line + elif line.startswith("FATAL:"): + if line.find("already carries isofs!"): + self.error = self.ERROR_ISOFS + else: + self.error = self.ERROR_UNKNOWN + print "BurnTask: unknown error %s" % line class RemoveDVDFolder(Task): def __init__(self, job): @@ -449,79 +456,70 @@ def CreateMenus(job): def CreateAuthoringXML(job): nr_titles = len(job.project.titles) titles_per_menu = getTitlesPerMenu(nr_titles) - authorxml = """ - - - - - - jump titleset 1 menu; - - - - - - - """ + authorxml = [] + authorxml.append('\n') + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n', ) + if job.project.menu: + authorxml.append(' jump titleset 1 menu; \n') + else: + authorxml.append(' jump title 1; \n') + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') + if job.project.menu: + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') for i in range( nr_titles ): chapters = ','.join(["%d:%02d:%02d.%03d" % (p / (90000 * 3600), p % (90000 * 3600) / (90000 * 60), p % (90000 * 60) / 90000, (p % 90000) / 90) for p in job.project.titles[i].chaptermarks]) - title_no = i+1 title_filename = job.workspace + "/dvd_title_%d.mpg" % (title_no) - if job.menupreview: LinkTS(job, job.project.vmgm, title_filename) else: MakeFifoNode(job, title_no) - vob_tag = """file="%s" chapters="%s" />""" % (title_filename, chapters) - - if title_no < nr_titles: + if job.project.linktitles and title_no < nr_titles: post_tag = "jump title %d;" % ( title_no+1 ) - else: + elif job.project.menu: post_tag = "call vmgm menu 1;" - authorxml += """ - - %s - """ % (vob_tag, post_tag) - - authorxml += """ - - - -""" + else: post_tag = "" + + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' ' + post_tag + ' \n') + authorxml.append(' \n') + + authorxml.append(' \n') + authorxml.append(' \n') + authorxml.append(' \n') f = open(job.workspace+"/dvdauthor.xml", "w") - f.write(authorxml) + for x in authorxml: + f.write(x) f.close() class DVDJob(Job): @@ -531,14 +529,15 @@ class DVDJob(Job): from time import strftime from Tools.Directories import SCOPE_HDD, resolveFilename, createDir new_workspace = resolveFilename(SCOPE_HDD) + "tmp/" + strftime("%Y%m%d%H%M%S") - createDir(new_workspace) + createDir(new_workspace, True) self.workspace = new_workspace self.project.workspace = self.workspace self.menupreview = menupreview self.conduct() def conduct(self): - CreateMenus(self) + if self.project.menu or self.menupreview: + CreateMenus(self) CreateAuthoringXML(self) totalsize = 50*1024*1024 # require an extra safety 50 MB