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
53cc84ec
Commit
53cc84ec
authored
Mar 07, 2017
by
林檎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#fix 148
parent
789a1af6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
web.py
cps/web.py
+6
-6
No files found.
cps/web.py
View file @
53cc84ec
...
...
@@ -1236,22 +1236,22 @@ def read_book(book_id, format):
zfile
.
close
()
return
render_title_template
(
'read.html'
,
bookid
=
book_id
,
title
=
_
(
u"Read a Book"
))
elif
format
.
lower
()
==
"pdf"
:
all_name
=
str
(
book_id
)
+
"/"
+
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
+
".pdf"
tmp_file
=
os
.
path
.
join
(
book_dir
,
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
)
+
".pdf"
all_name
=
str
(
book_id
)
+
"/"
+
book
.
data
[
0
]
.
name
+
".pdf"
tmp_file
=
os
.
path
.
join
(
book_dir
,
book
.
data
[
0
]
.
name
)
+
".pdf"
if
not
os
.
path
.
exists
(
tmp_file
):
pdf_file
=
os
.
path
.
join
(
config
.
config_calibre_dir
,
book
.
path
,
book
.
data
[
0
]
.
name
)
+
".pdf"
copyfile
(
pdf_file
,
tmp_file
)
return
render_title_template
(
'readpdf.html'
,
pdffile
=
all_name
,
title
=
_
(
u"Read a Book"
))
elif
format
.
lower
()
==
"txt"
:
all_name
=
str
(
book_id
)
+
"/"
+
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
+
".txt"
tmp_file
=
os
.
path
.
join
(
book_dir
,
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
)
+
".txt"
all_name
=
str
(
book_id
)
+
"/"
+
book
.
data
[
0
]
.
name
+
".txt"
tmp_file
=
os
.
path
.
join
(
book_dir
,
book
.
data
[
0
]
.
name
)
+
".txt"
if
not
os
.
path
.
exists
(
all_name
):
txt_file
=
os
.
path
.
join
(
config
.
config_calibre_dir
,
book
.
path
,
book
.
data
[
0
]
.
name
)
+
".txt"
copyfile
(
txt_file
,
tmp_file
)
return
render_title_template
(
'readtxt.html'
,
txtfile
=
all_name
,
title
=
_
(
u"Read a Book"
))
elif
format
.
lower
()
==
"cbr"
:
all_name
=
str
(
book_id
)
+
"/"
+
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
+
".cbr"
tmp_file
=
os
.
path
.
join
(
book_dir
,
urllib
.
quote
(
book
.
data
[
0
]
.
name
)
)
+
".cbr"
all_name
=
str
(
book_id
)
+
"/"
+
book
.
data
[
0
]
.
name
+
".cbr"
tmp_file
=
os
.
path
.
join
(
book_dir
,
book
.
data
[
0
]
.
name
)
+
".cbr"
if
not
os
.
path
.
exists
(
all_name
):
cbr_file
=
os
.
path
.
join
(
config
.
config_calibre_dir
,
book
.
path
,
book
.
data
[
0
]
.
name
)
+
".cbr"
copyfile
(
cbr_file
,
tmp_file
)
...
...
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