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
5b0a0e21
Commit
5b0a0e21
authored
Mar 08, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #835
parent
0744e84b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
web.py
cps/web.py
+9
-9
requirements.txt
requirements.txt
+1
-1
No files found.
cps/web.py
View file @
5b0a0e21
...
@@ -798,7 +798,7 @@ def feed_hot():
...
@@ -798,7 +798,7 @@ def feed_hot():
def
feed_authorindex
():
def
feed_authorindex
():
off
=
request
.
args
.
get
(
"offset"
)
or
0
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
=
db
.
session
.
query
(
db
.
Authors
)
.
join
(
db
.
books_authors_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
entries
=
db
.
session
.
query
(
db
.
Authors
)
.
join
(
db
.
books_authors_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_authors_link.author'
)
.
order_by
(
db
.
Authors
.
sort
)
.
limit
(
config
.
config_books_per_page
)
.
offset
(
off
)
.
group_by
(
text
(
'books_authors_link.author'
)
)
.
order_by
(
db
.
Authors
.
sort
)
.
limit
(
config
.
config_books_per_page
)
.
offset
(
off
)
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
len
(
db
.
session
.
query
(
db
.
Authors
)
.
all
()))
len
(
db
.
session
.
query
(
db
.
Authors
)
.
all
()))
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_author'
,
pagination
=
pagination
)
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_author'
,
pagination
=
pagination
)
...
@@ -818,7 +818,7 @@ def feed_author(book_id):
...
@@ -818,7 +818,7 @@ def feed_author(book_id):
def
feed_publisherindex
():
def
feed_publisherindex
():
off
=
request
.
args
.
get
(
"offset"
)
or
0
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
=
db
.
session
.
query
(
db
.
Publishers
)
.
join
(
db
.
books_publishers_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
entries
=
db
.
session
.
query
(
db
.
Publishers
)
.
join
(
db
.
books_publishers_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_publishers_link.publisher'
)
.
order_by
(
db
.
Publishers
.
sort
)
.
limit
(
config
.
config_books_per_page
)
.
offset
(
off
)
.
group_by
(
text
(
'books_publishers_link.publisher'
)
)
.
order_by
(
db
.
Publishers
.
sort
)
.
limit
(
config
.
config_books_per_page
)
.
offset
(
off
)
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
len
(
db
.
session
.
query
(
db
.
Publishers
)
.
all
()))
len
(
db
.
session
.
query
(
db
.
Publishers
)
.
all
()))
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_publisher'
,
pagination
=
pagination
)
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_publisher'
,
pagination
=
pagination
)
...
@@ -839,7 +839,7 @@ def feed_publisher(book_id):
...
@@ -839,7 +839,7 @@ def feed_publisher(book_id):
def
feed_categoryindex
():
def
feed_categoryindex
():
off
=
request
.
args
.
get
(
"offset"
)
or
0
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
=
db
.
session
.
query
(
db
.
Tags
)
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
entries
=
db
.
session
.
query
(
db
.
Tags
)
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_tags_link.tag'
)
.
order_by
(
db
.
Tags
.
name
)
.
offset
(
off
)
.
limit
(
config
.
config_books_per_page
)
.
group_by
(
text
(
'books_tags_link.tag'
)
)
.
order_by
(
db
.
Tags
.
name
)
.
offset
(
off
)
.
limit
(
config
.
config_books_per_page
)
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
len
(
db
.
session
.
query
(
db
.
Tags
)
.
all
()))
len
(
db
.
session
.
query
(
db
.
Tags
)
.
all
()))
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_category'
,
pagination
=
pagination
)
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_category'
,
pagination
=
pagination
)
...
@@ -859,7 +859,7 @@ def feed_category(book_id):
...
@@ -859,7 +859,7 @@ def feed_category(book_id):
def
feed_seriesindex
():
def
feed_seriesindex
():
off
=
request
.
args
.
get
(
"offset"
)
or
0
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
=
db
.
session
.
query
(
db
.
Series
)
.
join
(
db
.
books_series_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
entries
=
db
.
session
.
query
(
db
.
Series
)
.
join
(
db
.
books_series_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_series_link.series'
)
.
order_by
(
db
.
Series
.
sort
)
.
offset
(
off
)
.
all
()
.
group_by
(
text
(
'books_series_link.series'
)
)
.
order_by
(
db
.
Series
.
sort
)
.
offset
(
off
)
.
all
()
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
len
(
db
.
session
.
query
(
db
.
Series
)
.
all
()))
len
(
db
.
session
.
query
(
db
.
Series
)
.
all
()))
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_series'
,
pagination
=
pagination
)
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_series'
,
pagination
=
pagination
)
...
@@ -1321,7 +1321,7 @@ def author_list():
...
@@ -1321,7 +1321,7 @@ def author_list():
if
current_user
.
show_author
():
if
current_user
.
show_author
():
entries
=
db
.
session
.
query
(
db
.
Authors
,
func
.
count
(
'books_authors_link.book'
)
.
label
(
'count'
))
\
entries
=
db
.
session
.
query
(
db
.
Authors
,
func
.
count
(
'books_authors_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_authors_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
join
(
db
.
books_authors_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_authors_link.author'
)
.
order_by
(
db
.
Authors
.
sort
)
.
all
()
.
group_by
(
text
(
'books_authors_link.author'
)
)
.
order_by
(
db
.
Authors
.
sort
)
.
all
()
for
entry
in
entries
:
for
entry
in
entries
:
entry
.
Authors
.
name
=
entry
.
Authors
.
name
.
replace
(
'|'
,
','
)
entry
.
Authors
.
name
=
entry
.
Authors
.
name
.
replace
(
'|'
,
','
)
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'author'
,
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'author'
,
...
@@ -1363,7 +1363,7 @@ def publisher_list():
...
@@ -1363,7 +1363,7 @@ def publisher_list():
if
current_user
.
show_publisher
():
if
current_user
.
show_publisher
():
entries
=
db
.
session
.
query
(
db
.
Publishers
,
func
.
count
(
'books_publishers_link.book'
)
.
label
(
'count'
))
\
entries
=
db
.
session
.
query
(
db
.
Publishers
,
func
.
count
(
'books_publishers_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_publishers_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
join
(
db
.
books_publishers_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_publishers_link.publisher'
)
.
order_by
(
db
.
Publishers
.
sort
)
.
all
()
.
group_by
(
text
(
'books_publishers_link.publisher'
)
)
.
order_by
(
db
.
Publishers
.
sort
)
.
all
()
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'publisher'
,
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'publisher'
,
title
=
_
(
u"Publisher list"
),
page
=
"publisherlist"
)
title
=
_
(
u"Publisher list"
),
page
=
"publisherlist"
)
else
:
else
:
...
@@ -1410,7 +1410,7 @@ def series_list():
...
@@ -1410,7 +1410,7 @@ def series_list():
if
current_user
.
show_series
():
if
current_user
.
show_series
():
entries
=
db
.
session
.
query
(
db
.
Series
,
func
.
count
(
'books_series_link.book'
)
.
label
(
'count'
))
\
entries
=
db
.
session
.
query
(
db
.
Series
,
func
.
count
(
'books_series_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_series_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
join
(
db
.
books_series_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_series_link.series'
)
.
order_by
(
db
.
Series
.
sort
)
.
all
()
.
group_by
(
text
(
'books_series_link.series'
)
)
.
order_by
(
db
.
Series
.
sort
)
.
all
()
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'series'
,
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'series'
,
title
=
_
(
u"Series list"
),
page
=
"serieslist"
)
title
=
_
(
u"Series list"
),
page
=
"serieslist"
)
else
:
else
:
...
@@ -1450,7 +1450,7 @@ def language_overview():
...
@@ -1450,7 +1450,7 @@ def language_overview():
languages
[
0
]
.
name
=
_
(
isoLanguages
.
get
(
part3
=
languages
[
0
]
.
lang_code
)
.
name
)
languages
[
0
]
.
name
=
_
(
isoLanguages
.
get
(
part3
=
languages
[
0
]
.
lang_code
)
.
name
)
lang_counter
=
db
.
session
.
query
(
db
.
books_languages_link
,
lang_counter
=
db
.
session
.
query
(
db
.
books_languages_link
,
func
.
count
(
'books_languages_link.book'
)
.
label
(
'bookcount'
))
.
group_by
(
func
.
count
(
'books_languages_link.book'
)
.
label
(
'bookcount'
))
.
group_by
(
'books_languages_link.lang_code'
)
.
all
()
text
(
'books_languages_link.lang_code'
)
)
.
all
()
return
render_title_template
(
'languages.html'
,
languages
=
languages
,
lang_counter
=
lang_counter
,
return
render_title_template
(
'languages.html'
,
languages
=
languages
,
lang_counter
=
lang_counter
,
title
=
_
(
u"Available languages"
),
page
=
"langlist"
)
title
=
_
(
u"Available languages"
),
page
=
"langlist"
)
else
:
else
:
...
@@ -1481,7 +1481,7 @@ def category_list():
...
@@ -1481,7 +1481,7 @@ def category_list():
if
current_user
.
show_category
():
if
current_user
.
show_category
():
entries
=
db
.
session
.
query
(
db
.
Tags
,
func
.
count
(
'books_tags_link.book'
)
.
label
(
'count'
))
\
entries
=
db
.
session
.
query
(
db
.
Tags
,
func
.
count
(
'books_tags_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
order_by
(
db
.
Tags
.
name
)
.
filter
(
common_filters
())
\
.
join
(
db
.
books_tags_link
)
.
join
(
db
.
Books
)
.
order_by
(
db
.
Tags
.
name
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_tags_link.tag'
)
.
all
()
.
group_by
(
text
(
'books_tags_link.tag'
)
)
.
all
()
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'category'
,
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'category'
,
title
=
_
(
u"Category list"
),
page
=
"catlist"
)
title
=
_
(
u"Category list"
),
page
=
"catlist"
)
else
:
else
:
...
...
requirements.txt
View file @
5b0a0e21
...
@@ -9,7 +9,7 @@ iso-639>=0.4.5
...
@@ -9,7 +9,7 @@ iso-639>=0.4.5
PyPDF2
==1.26.0
PyPDF2
==1.26.0
pytz
>=2016.10
pytz
>=2016.10
requests
>=2.11.1
requests
>=2.11.1
SQLAlchemy
>=1.1.0
,<1.3.0
SQLAlchemy
>=1.1.0
tornado
>=4.1
tornado
>=4.1
Wand
>=0.4.4
Wand
>=0.4.4
unidecode
>=0.04.19
unidecode
>=0.04.19
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