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
0d64692c
Commit
0d64692c
authored
Sep 30, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for convert + email task with gdrive
parent
2d982855
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
editbooks.py
cps/editbooks.py
+1
-1
convert.py
cps/tasks/convert.py
+2
-3
No files found.
cps/editbooks.py
View file @
0d64692c
...
...
@@ -260,7 +260,7 @@ def delete_book(book_id, book_format, jsonResponse):
filter
(
db
.
Data
.
format
==
book_format
)
.
delete
()
calibre_db
.
session
.
commit
()
except
Exception
as
e
:
log
.
debug
(
e
)
log
.
exception
(
e
)
calibre_db
.
session
.
rollback
()
else
:
# book not found
...
...
cps/tasks/convert.py
View file @
0d64692c
...
...
@@ -52,7 +52,6 @@ class TaskConvert(CalibreTask):
return
self
.
_handleError
(
str
(
e
))
def
_convert_ebook_format
(
self
):
error_message
=
None
local_session
=
db
.
Session
()
file_path
=
self
.
file_path
book_id
=
self
.
bookid
...
...
@@ -68,7 +67,7 @@ class TaskConvert(CalibreTask):
self
.
results
[
'path'
]
=
file_path
self
.
results
[
'title'
]
=
cur_book
.
title
self
.
_handleSuccess
()
return
file_path
+
format_new_ext
return
os
.
path
.
basename
(
file_path
+
format_new_ext
)
else
:
log
.
info
(
"Book id
%
d - target format of
%
s does not exist. Moving forward with convert."
,
book_id
,
...
...
@@ -105,7 +104,7 @@ class TaskConvert(CalibreTask):
if
config
.
config_use_google_drive
:
os
.
remove
(
file_path
+
format_old_ext
)
self
.
_handleSuccess
()
return
file_path
+
format_new_ext
return
os
.
path
.
basename
(
file_path
+
format_new_ext
)
else
:
error_message
=
_
(
'
%(format)
s format not found on disk'
,
format
=
format_new_ext
.
upper
())
log
.
info
(
"ebook converter failed with error while converting book"
)
...
...
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