Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
ded48020
Commit
ded48020
authored
Aug 30, 2020
by
blitzmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add link to convert task, fixes #1589
parent
cdaad2fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
helper.py
cps/helper.py
+7
-2
No files found.
cps/helper.py
View file @
ded48020
...
@@ -32,7 +32,7 @@ from tempfile import gettempdir
...
@@ -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,
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment