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
6229e461
Commit
6229e461
authored
Mar 15, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated teststatus and bugfix convert ebooks
parent
53ee0aae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
451 additions
and
234 deletions
+451
-234
helper.py
cps/helper.py
+21
-41
Calibre-Web TestSummary_Linux.html
test/Calibre-Web TestSummary_Linux.html
+430
-193
No files found.
cps/helper.py
View file @
6229e461
...
@@ -137,43 +137,8 @@ def send_registration_mail(e_mail, user_name, default_password, resend=False):
...
@@ -137,43 +137,8 @@ def send_registration_mail(e_mail, user_name, default_password, resend=False):
return
return
def
check_send_to_kindle_with
out_converter
(
entry
):
def
check_send_to_kindle_with
_converter
(
formats
):
bookformats
=
list
()
bookformats
=
list
()
# no converter - only for mobi and pdf formats
for
ele
in
iter
(
entry
.
data
):
if
ele
.
uncompressed_size
<
config
.
mail_size
:
if
'MOBI'
in
ele
.
format
:
bookformats
.
append
({
'format'
:
'Mobi'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Mobi'
)})
if
'PDF'
in
ele
.
format
:
bookformats
.
append
({
'format'
:
'Pdf'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Pdf'
)})
if
'AZW'
in
ele
.
format
:
bookformats
.
append
({
'format'
:
'Azw'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Azw'
)})
return
bookformats
def
check_send_to_kindle_with_converter
(
entry
):
bookformats
=
list
()
formats
=
list
()
for
ele
in
iter
(
entry
.
data
):
if
ele
.
uncompressed_size
<
config
.
mail_size
:
formats
.
append
(
ele
.
format
)
if
'MOBI'
in
formats
:
bookformats
.
append
({
'format'
:
'Mobi'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Mobi'
)})
if
'AZW'
in
formats
:
bookformats
.
append
({
'format'
:
'Azw'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Azw'
)})
if
'PDF'
in
formats
:
bookformats
.
append
({
'format'
:
'Pdf'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Pdf'
)})
if
'EPUB'
in
formats
and
'MOBI'
not
in
formats
:
if
'EPUB'
in
formats
and
'MOBI'
not
in
formats
:
bookformats
.
append
({
'format'
:
'Mobi'
,
bookformats
.
append
({
'format'
:
'Mobi'
,
'convert'
:
1
,
'convert'
:
1
,
...
@@ -193,12 +158,27 @@ def check_send_to_kindle(entry):
...
@@ -193,12 +158,27 @@ def check_send_to_kindle(entry):
"""
"""
returns all available book formats for sending to Kindle
returns all available book formats for sending to Kindle
"""
"""
formats
=
list
()
bookformats
=
list
()
if
len
(
entry
.
data
):
if
len
(
entry
.
data
):
if
not
config
.
config_converterpath
:
for
ele
in
iter
(
entry
.
data
):
book_formats
=
check_send_to_kindle_with_converter
(
entry
)
if
ele
.
uncompressed_size
<
config
.
mail_size
:
else
:
formats
.
append
(
ele
.
format
)
book_formats
=
check_send_to_kindle_with_converter
(
entry
)
if
'MOBI'
in
formats
:
return
book_formats
bookformats
.
append
({
'format'
:
'Mobi'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Mobi'
)})
if
'PDF'
in
formats
:
bookformats
.
append
({
'format'
:
'Pdf'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Pdf'
)})
if
'AZW'
in
formats
:
bookformats
.
append
({
'format'
:
'Azw'
,
'convert'
:
0
,
'text'
:
_
(
'Send
%(format)
s to Kindle'
,
format
=
'Azw'
)})
if
config
.
config_converterpath
:
bookformats
.
extend
(
check_send_to_kindle_with_converter
(
formats
))
return
bookformats
else
:
else
:
log
.
error
(
u'Cannot find book entry
%
d'
,
entry
.
id
)
log
.
error
(
u'Cannot find book entry
%
d'
,
entry
.
id
)
return
None
return
None
...
...
test/Calibre-Web TestSummary_Linux.html
View file @
6229e461
This diff is collapsed.
Click to expand it.
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