pull/1539/merge
Ozzieisaacs 4 years ago
parent 0d64692c84
commit 23d66a0d68

@ -102,7 +102,7 @@ def convert_book_format(book_id, calibrepath, old_book_format, new_book_format,
txt = (u"%s -> %s: %s" % (old_book_format, new_book_format, book.title)) txt = (u"%s -> %s: %s" % (old_book_format, new_book_format, book.title))
settings['old_book_format'] = old_book_format settings['old_book_format'] = old_book_format
settings['new_book_format'] = new_book_format settings['new_book_format'] = new_book_format
WorkerThread.add(user_id, TaskConvert(file_path, book.id, txt, settings, kindle_mail)) WorkerThread.add(user_id, TaskConvert(file_path, book.id, txt, settings, kindle_mail, user_id))
return None return None
else: else:
error_message = _(u"%(format)s not found: %(fn)s", error_message = _(u"%(format)s not found: %(fn)s",

@ -20,12 +20,13 @@ log = logger.create()
class TaskConvert(CalibreTask): class TaskConvert(CalibreTask):
def __init__(self, file_path, bookid, taskMessage, settings, kindle_mail): def __init__(self, file_path, bookid, taskMessage, settings, kindle_mail, user=None):
super(TaskConvert, self).__init__(taskMessage) super(TaskConvert, self).__init__(taskMessage)
self.file_path = file_path self.file_path = file_path
self.bookid = bookid self.bookid = bookid
self.settings = settings self.settings = settings
self.kindle_mail = kindle_mail self.kindle_mail = kindle_mail
self.user = user
self.results = dict() self.results = dict()
@ -40,14 +41,9 @@ class TaskConvert(CalibreTask):
# if we're sending to kindle after converting, create a one-off task and run it immediately # if we're sending to kindle after converting, create a one-off task and run it immediately
# todo: figure out how to incorporate this into the progress # todo: figure out how to incorporate this into the progress
try: try:
task = TaskEmail(self.settings['subject'], self.results["path"], worker_thread.add(self.user, TaskEmail(self.settings['subject'], self.results["path"],
filename, self.settings, self.kindle_mail, filename, self.settings, self.kindle_mail,
self.settings['subject'], self.settings['body'], internal=True) self.settings['subject'], self.settings['body'], internal=True))
task.start(worker_thread)
# even though the convert task might be finished, if this task fails, fail the whole thing
if task.stat != STAT_FINISH_SUCCESS:
raise Exception(task.error)
except Exception as e: except Exception as e:
return self._handleError(str(e)) return self._handleError(str(e))

@ -227,6 +227,7 @@ class Updater(threading.Thread):
os.sep + 'vendor', os.sep + 'calibre-web.log', os.sep + '.git', os.sep + 'client_secrets.json', os.sep + 'vendor', os.sep + 'calibre-web.log', os.sep + '.git', os.sep + 'client_secrets.json',
os.sep + 'gdrive_credentials', os.sep + 'settings.yaml', os.sep + 'venv', os.sep + 'virtualenv', os.sep + 'gdrive_credentials', os.sep + 'settings.yaml', os.sep + 'venv', os.sep + 'virtualenv',
os.sep + 'access.log', os.sep + 'access.log1', os.sep + 'access.log2', os.sep + 'access.log', os.sep + 'access.log1', os.sep + 'access.log2',
os.sep + '.calibre-web.log.swp'
) )
additional_path = self.is_venv() additional_path = self.is_venv()
if additional_path: if additional_path:

Loading…
Cancel
Save