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
06a4af44
Commit
06a4af44
authored
Mar 16, 2017
by
Jack Darlington
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
# Conflicts: # cps/web.py
parents
ff89d9c2
a87fab87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
detail.html
cps/templates/detail.html
+1
-1
web.py
cps/web.py
+9
-6
No files found.
cps/templates/detail.html
View file @
06a4af44
...
...
@@ -2,7 +2,7 @@
{% block body %}
<div
class=
"single"
>
<div
class=
"row"
>
<div
class=
"col-sm-3 col-lg-3 col-xs-
12
"
>
<div
class=
"col-sm-3 col-lg-3 col-xs-
5
"
>
<div
class=
"cover"
>
{% if entry.has_cover %}
<img
src=
"{{ url_for('get_cover', cover_path=entry.path.replace('\\','/')) }}"
/>
...
...
cps/web.py
View file @
06a4af44
...
...
@@ -63,13 +63,12 @@ from tornado import version as tornadoVersion
try
:
from
urllib.parse
import
quote
from
imp
import
reload
from
past.builtins
import
xrange
except
ImportError
:
except
ImportError
as
e
:
from
urllib
import
quote
try
:
from
flask_login
import
__version__
as
flask_loginVersion
except
ImportError
:
except
ImportError
as
e
:
from
flask_login.__about__
import
__version__
as
flask_loginVersion
import
time
...
...
@@ -345,6 +344,10 @@ class Pagination(object):
def
iter_pages
(
self
,
left_edge
=
2
,
left_current
=
2
,
right_current
=
5
,
right_edge
=
2
):
last
=
0
if
'xrange'
not
in
globals
():
#no xrange in Python3
global
xrange
xrange
=
range
for
num
in
xrange
(
1
,
self
.
pages
+
1
):
# ToDo: can be simplified
if
num
<=
left_edge
or
(
num
>
self
.
page
-
left_current
-
1
and
num
<
self
.
page
+
right_current
)
\
or
num
>
self
.
pages
-
right_edge
:
...
...
@@ -819,10 +822,10 @@ def get_opds_download_link(book_id, format):
helper
.
update_download
(
book_id
,
int
(
current_user
.
id
))
file_name
=
book
.
title
if
len
(
book
.
authors
)
>
0
:
file_name
=
book
.
authors
[
0
]
.
name
+
'
-
'
+
file_name
file_name
=
book
.
authors
[
0
]
.
name
+
'
_
'
+
file_name
file_name
=
helper
.
get_valid_filename
(
file_name
)
headers
=
{}
headers
[
"Content-Disposition"
]
=
"attachment; filename*=UTF-8''
%
s.
%
s"
%
(
urllib
.
quote
(
file_name
.
encode
(
'utf8'
)),
format
)
headers
[
"Content-Disposition"
]
=
"attachment; filename*=UTF-8''
%
s.
%
s"
%
(
quote
(
file_name
.
encode
(
'utf8'
)),
format
)
app
.
logger
.
info
(
time
.
time
()
-
startTime
)
startTime
=
time
.
time
()
if
config
.
config_use_google_drive
:
...
...
@@ -1643,7 +1646,7 @@ def get_download_link(book_id, format):
helper
.
update_download
(
book_id
,
int
(
current_user
.
id
))
file_name
=
book
.
title
if
len
(
book
.
authors
)
>
0
:
file_name
=
book
.
authors
[
0
]
.
name
+
'
-
'
+
file_name
file_name
=
book
.
authors
[
0
]
.
name
+
'
_
'
+
file_name
file_name
=
helper
.
get_valid_filename
(
file_name
)
headers
=
{}
try
:
...
...
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