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
fc855868
Commit
fc855868
authored
Mar 22, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes for sqlalchemy 1.4.0
parent
837fc498
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
db.py
cps/db.py
+7
-5
web.py
cps/web.py
+5
-1
No files found.
cps/db.py
View file @
fc855868
...
@@ -627,15 +627,17 @@ class CalibreDB():
...
@@ -627,15 +627,17 @@ class CalibreDB():
randm
=
self
.
session
.
query
(
Books
)
\
randm
=
self
.
session
.
query
(
Books
)
\
.
filter
(
self
.
common_filters
(
allow_show_archived
))
\
.
filter
(
self
.
common_filters
(
allow_show_archived
))
\
.
order_by
(
func
.
random
())
\
.
order_by
(
func
.
random
())
\
.
limit
(
self
.
config
.
config_random_books
)
.
limit
(
self
.
config
.
config_random_books
)
.
all
()
else
:
else
:
randm
=
false
()
randm
=
false
()
off
=
int
(
int
(
pagesize
)
*
(
page
-
1
))
off
=
int
(
int
(
pagesize
)
*
(
page
-
1
))
query
=
self
.
session
.
query
(
database
)
\
query
=
self
.
session
.
query
(
database
)
.
filter
(
db_filter
)
\
if
len
(
join
)
==
3
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
.
outerjoin
(
join
[
2
])
elif
len
(
join
)
==
2
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
query
=
query
.
filter
(
db_filter
)
\
.
filter
(
self
.
common_filters
(
allow_show_archived
))
.
filter
(
self
.
common_filters
(
allow_show_archived
))
if
len
(
join
):
query
=
query
.
join
(
*
join
,
isouter
=
True
)
entries
=
list
()
entries
=
list
()
pagination
=
list
()
pagination
=
list
()
try
:
try
:
...
...
cps/web.py
View file @
fc855868
...
@@ -502,6 +502,7 @@ def render_author_books(page, author_id, order):
...
@@ -502,6 +502,7 @@ def render_author_books(page, author_id, order):
db
.
Books
.
authors
.
any
(
db
.
Authors
.
id
==
author_id
),
db
.
Books
.
authors
.
any
(
db
.
Authors
.
id
==
author_id
),
[
order
[
0
],
db
.
Series
.
name
,
db
.
Books
.
series_index
],
[
order
[
0
],
db
.
Series
.
name
,
db
.
Books
.
series_index
],
db
.
books_series_link
,
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
)
db
.
Series
)
if
entries
is
None
or
not
len
(
entries
):
if
entries
is
None
or
not
len
(
entries
):
flash
(
_
(
u"Oops! Selected book title is unavailable. File does not exist or is not accessible"
),
flash
(
_
(
u"Oops! Selected book title is unavailable. File does not exist or is not accessible"
),
...
@@ -530,6 +531,7 @@ def render_publisher_books(page, book_id, order):
...
@@ -530,6 +531,7 @@ def render_publisher_books(page, book_id, order):
db
.
Books
.
publishers
.
any
(
db
.
Publishers
.
id
==
book_id
),
db
.
Books
.
publishers
.
any
(
db
.
Publishers
.
id
==
book_id
),
[
db
.
Series
.
name
,
order
[
0
],
db
.
Books
.
series_index
],
[
db
.
Series
.
name
,
order
[
0
],
db
.
Books
.
series_index
],
db
.
books_series_link
,
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
)
db
.
Series
)
return
render_title_template
(
'index.html'
,
random
=
random
,
entries
=
entries
,
pagination
=
pagination
,
id
=
book_id
,
return
render_title_template
(
'index.html'
,
random
=
random
,
entries
=
entries
,
pagination
=
pagination
,
id
=
book_id
,
title
=
_
(
u"Publisher:
%(name)
s"
,
name
=
publisher
.
name
),
page
=
"publisher"
)
title
=
_
(
u"Publisher:
%(name)
s"
,
name
=
publisher
.
name
),
page
=
"publisher"
)
...
@@ -583,7 +585,9 @@ def render_category_books(page, book_id, order):
...
@@ -583,7 +585,9 @@ def render_category_books(page, book_id, order):
db
.
Books
,
db
.
Books
,
db
.
Books
.
tags
.
any
(
db
.
Tags
.
id
==
book_id
),
db
.
Books
.
tags
.
any
(
db
.
Tags
.
id
==
book_id
),
[
order
[
0
],
db
.
Series
.
name
,
db
.
Books
.
series_index
],
[
order
[
0
],
db
.
Series
.
name
,
db
.
Books
.
series_index
],
db
.
books_series_link
,
db
.
Series
)
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
)
return
render_title_template
(
'index.html'
,
random
=
random
,
entries
=
entries
,
pagination
=
pagination
,
id
=
book_id
,
return
render_title_template
(
'index.html'
,
random
=
random
,
entries
=
entries
,
pagination
=
pagination
,
id
=
book_id
,
title
=
_
(
u"Category:
%(name)
s"
,
name
=
name
.
name
),
page
=
"category"
)
title
=
_
(
u"Category:
%(name)
s"
,
name
=
name
.
name
),
page
=
"category"
)
else
:
else
:
...
...
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