From a000de02708cfd51c3d8951b58837fee96bc1839 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 23 Aug 2020 13:33:57 -0400 Subject: [PATCH] Some clean up --- cps/tasks/convert.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index cb6d9d81..0039539a 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -85,8 +85,6 @@ class TaskConvert(CalibreTask): book_format=self.settings['new_book_format'].upper(), book=book_id, uncompressed_size=os.path.getsize(file_path + format_new_ext)) - # todo: this may not be needed anymore, might be able to access the DB directly now. See #1565 - cur_book = calibre_db.session.query(db.Books).filter(db.Books.id == book_id).first() cur_book.data.append(new_format) try: @@ -95,16 +93,7 @@ class TaskConvert(CalibreTask): except SQLAlchemyError as e: calibre_db.session.rollback() log.error("Database error: %s", e) - - '''cur_book.data.append(new_format) - try: - # db.session.merge(cur_book) - calibre_db.session.commit() - except OperationalError as e: - calibre_db.session.rollback() - log.error("Database error: %s", e) - self._handleError(_(u"Database error: %(error)s.", error=e)) - return''' + return self.results['path'] = cur_book.path self.results['title'] = cur_book.title