Fixes from merge problems

This commit is contained in:
OzzieIsaacs
2020-10-10 07:30:03 +02:00
4 changed files with 116 additions and 47 deletions
-6
View File
@@ -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"<Books('{0},{1}{2}{3}{4}{5}{6}{7}{8}')>".format(self.title, self.sort, self.author_sort,
+5 -2
View File
@@ -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,
"<a href=\"" + url_for('web.show_book', book_id=book.id) + "\">" + book.title + "</a>"))
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))
+1 -1
View File
@@ -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()