Add link to convert task, fixes #1589

This commit is contained in:
blitzmann 2020-08-30 13:54:51 -04:00
parent cdaad2fb4a
commit ded480207b

View File

@ -32,7 +32,7 @@ from tempfile import gettempdir
import requests import requests
from babel.dates import format_datetime from babel.dates import format_datetime
from babel.units import format_unit 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_babel import gettext as _
from flask_login import current_user from flask_login import current_user
from sqlalchemy.sql.expression import true, false, and_, text, func from sqlalchemy.sql.expression import true, false, and_, text, func
@ -98,7 +98,12 @@ def convert_book_format(book_id, calibrepath, old_book_format, new_book_format,
# text = _(u"%(format)s: %(book)s", format=new_book_format, book=book.title) # text = _(u"%(format)s: %(book)s", format=new_book_format, book=book.title)
else: else:
settings = dict() 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['old_book_format'] = old_book_format
settings['new_book_format'] = new_book_format settings['new_book_format'] = new_book_format
worker.add_convert(file_path, book.id, user_id, txt, settings, kindle_mail) worker.add_convert(file_path, book.id, user_id, txt, settings, kindle_mail)