diff --git a/cps/db.py b/cps/db.py index d89a38ed..3e0ac195 100644 --- a/cps/db.py +++ b/cps/db.py @@ -46,7 +46,6 @@ from weakref import WeakSet try: import unidecode - use_unidecode = True except ImportError: use_unidecode = False @@ -100,9 +99,6 @@ class Identifiers(Base): self.type = id_type self.book = book - # def get(self): - # return {self.type: self.val} - def formatType(self): format_type = self.type.lower() if format_type == 'amazon': @@ -355,8 +351,6 @@ class Books(Base): self.path = path self.has_cover = (has_cover != None) - # def as_dict(self): - # return {c.name: getattr(self, c.name) for c in self.__table__.columns} def __repr__(self): return u"".format(self.title, self.sort, self.author_sort, diff --git a/cps/helper.py b/cps/helper.py index b0ea7ff7..f946a039 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -32,7 +32,7 @@ from tempfile import gettempdir import requests from babel.dates import format_datetime from babel.units import format_unit -from flask import send_from_directory, make_response, redirect, abort +from flask import send_from_directory, make_response, redirect, abort, url_for from flask_babel import gettext as _ from flask_login import current_user from sqlalchemy.sql.expression import true, false, and_, text, func @@ -96,7 +96,10 @@ def convert_book_format(book_id, calibrepath, old_book_format, new_book_format, settings['body'] = _(u'This e-mail has been sent via Calibre-Web.') else: settings = dict() - 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['new_book_format'] = new_book_format WorkerThread.add(user_id, TaskConvert(file_path, book.id, txt, settings, kindle_mail, user_id)) diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index 20f41a43..b60d4976 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -71,7 +71,7 @@ class TaskConvert(CalibreTask): def _convert_ebook_format(self): error_message = None - local_session = db.CalibreDB() + local_session = db.CalibreDB().session file_path = self.file_path book_id = self.bookid format_old_ext = u'.' + self.settings['old_book_format'].lower() diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 0bd45645..8fbf5f65 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
-

Start Time: 2020-10-04 19:26:20

+

Start Time: 2020-10-09 21:55:15

-

Stop Time: 2020-10-04 21:13:13

+

Stop Time: 2020-10-09 23:56:21

-

Duration: 1h 26 min

+

Duration: 1h 36 min

@@ -1768,55 +1768,46 @@ AssertionError: False is not true : Browser-Cache Problem: Old Cover is displaye - - _ErrorHolder - 1 + + TestLdapLogin + 11 + 10 0 0 1 - 0 - Detail + Detail - + + +
TestLdapLogin - test_LDAP_SSL
+ + PASS + + + + + -
setUpClass (test_ldap)
+
TestLdapLogin - test_LDAP_SSL_CERTIFICATE
- ERROR + SKIP
-
@@ -3404,11 +3476,11 @@ AssertionError: Total - 273 - 251 + 283 + 261 6 - 4 - 12 + 3 + 13   @@ -3760,7 +3832,7 @@ AssertionError: