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
e7b6963a
Commit
e7b6963a
authored
Nov 19, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small improvements for comic reader calls
parent
57567850
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
web.py
cps/web.py
+6
-7
No files found.
cps/web.py
View file @
e7b6963a
...
...
@@ -920,7 +920,7 @@ def get_metadata_calibre_companion(uuid):
def
get_comic_book
(
book_id
,
book_format
,
page
):
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
if
not
book
:
return
""
return
""
,
204
else
:
for
bookformat
in
book
.
data
:
if
bookformat
.
format
.
lower
()
==
book_format
.
lower
():
...
...
@@ -935,12 +935,12 @@ def get_comic_book(book_id, book_format, page):
fileData
=
{
"name"
:
rarNames
[
page
],
"page"
:
page
,
"last"
:
rarNames
.
__len__
()
-
1
,
"content"
:
extractedfile
}
except
:
# rarfile not valid
app
.
logger
.
error
(
'Unrar binary not found unable to decompress file '
+
cbr_file
)
return
""
app
.
logger
.
error
(
'Unrar binary not found
, or
unable to decompress file '
+
cbr_file
)
return
""
,
204
else
:
app
.
logger
.
info
(
'Unrar is not supported please install python rarfile extension'
)
# no support means return nothing
return
""
return
""
,
204
if
book_format
==
"cbz"
:
zf
=
zipfile
.
ZipFile
(
cbr_file
)
zipNames
=
zf
.
namelist
()
...
...
@@ -1961,9 +1961,8 @@ def read_book(book_id, book_format):
for
fileext
in
extensionList
:
if
book_format
.
lower
()
==
fileext
:
return
render_title_template
(
'readcbr.html'
,
comicfile
=
book_id
,
extension
=
fileext
,
title
=
_
(
u"Read a Book"
))
else
:
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible:"
),
category
=
"error"
)
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible."
),
category
=
"error"
)
return
redirect
(
url_for
(
"index"
))
@
app
.
route
(
"/download/<int:book_id>/<book_format>"
)
@
login_required_if_no_ano
...
...
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