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
850a8591
Commit
850a8591
authored
May 05, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1354 (Error on uploading single book, because of missing rarfile)
parent
fcbeeca3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
editbooks.py
cps/editbooks.py
+1
-1
helper.py
cps/helper.py
+1
-0
No files found.
cps/editbooks.py
View file @
850a8591
...
@@ -453,7 +453,7 @@ def upload_single_file(request, book, book_id):
...
@@ -453,7 +453,7 @@ def upload_single_file(request, book, book_id):
"<a href=
\"
"
+
url_for
(
'web.show_book'
,
book_id
=
book
.
id
)
+
"
\"
>"
+
uploadText
+
"</a>"
)
"<a href=
\"
"
+
url_for
(
'web.show_book'
,
book_id
=
book
.
id
)
+
"
\"
>"
+
uploadText
+
"</a>"
)
return
uploader
.
process
(
return
uploader
.
process
(
saved_filename
,
*
os
.
path
.
splitext
(
requested_file
.
filename
))
saved_filename
,
*
os
.
path
.
splitext
(
requested_file
.
filename
)
,
config
.
config_rarfile_location
)
def
upload_cover
(
request
,
book
):
def
upload_cover
(
request
,
book
):
...
...
cps/helper.py
View file @
850a8591
...
@@ -292,6 +292,7 @@ def delete_book_file(book, calibrepath, book_format=None):
...
@@ -292,6 +292,7 @@ def delete_book_file(book, calibrepath, book_format=None):
for
file
in
os
.
listdir
(
path
):
for
file
in
os
.
listdir
(
path
):
if
file
.
upper
()
.
endswith
(
"."
+
book_format
):
if
file
.
upper
()
.
endswith
(
"."
+
book_format
):
os
.
remove
(
os
.
path
.
join
(
path
,
file
))
os
.
remove
(
os
.
path
.
join
(
path
,
file
))
return
True
,
None
else
:
else
:
if
os
.
path
.
isdir
(
path
):
if
os
.
path
.
isdir
(
path
):
if
len
(
next
(
os
.
walk
(
path
))[
1
]):
if
len
(
next
(
os
.
walk
(
path
))[
1
]):
...
...
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