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
a32b36bf
Commit
a32b36bf
authored
Jul 30, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed missing joins for sorting according to series in read/unread and rated views
parent
a63baa17
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
db.py
cps/db.py
+4
-0
web.py
cps/web.py
+12
-2
No files found.
cps/db.py
View file @
a32b36bf
...
...
@@ -692,6 +692,10 @@ class CalibreDB():
query
=
self
.
session
.
query
(
database
)
if
len
(
join
)
==
6
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
.
outerjoin
(
join
[
2
])
.
outerjoin
(
join
[
3
],
join
[
4
])
.
outerjoin
(
join
[
5
])
if
len
(
join
)
==
5
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
.
outerjoin
(
join
[
2
])
.
outerjoin
(
join
[
3
],
join
[
4
])
if
len
(
join
)
==
4
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
.
outerjoin
(
join
[
2
])
.
outerjoin
(
join
[
3
])
if
len
(
join
)
==
3
:
query
=
query
.
outerjoin
(
join
[
0
],
join
[
1
])
.
outerjoin
(
join
[
2
])
elif
len
(
join
)
==
2
:
...
...
cps/web.py
View file @
a32b36bf
...
...
@@ -423,7 +423,11 @@ def render_rated_books(page, book_id, order):
entries
,
random
,
pagination
=
calibre_db
.
fill_indexpage
(
page
,
0
,
db
.
Books
,
db
.
Books
.
ratings
.
any
(
db
.
Ratings
.
rating
>
9
),
order
)
order
,
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
,
title
=
_
(
u"Top Rated Books"
),
page
=
"rated"
)
else
:
...
...
@@ -629,6 +633,9 @@ def render_read_books(page, are_read, as_xml=False, order=None):
db
.
Books
,
db_filter
,
order
,
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
,
ub
.
ReadBook
,
db
.
Books
.
id
==
ub
.
ReadBook
.
book_id
)
else
:
try
:
...
...
@@ -640,6 +647,9 @@ def render_read_books(page, are_read, as_xml=False, order=None):
db
.
Books
,
db_filter
,
order
,
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
,
db
.
cc_classes
[
config
.
config_read_column
])
except
(
KeyError
,
AttributeError
):
log
.
error
(
"Custom Column No.
%
d is not existing in calibre database"
,
config
.
config_read_column
)
...
...
@@ -787,7 +797,7 @@ def list_books():
db
.
books_series_link
,
db
.
Books
.
id
==
db
.
books_series_link
.
c
.
book
,
db
.
Series
elif
sort
==
"languages"
:
order
=
[
db
.
Languages
.
lang_code
.
asc
()]
if
order
==
"asc"
else
[
db
.
Languages
.
lang_code
.
desc
()]
join
=
db
.
books_languages_link
,
db
.
Books
.
id
==
db
.
books_languages_link
.
c
.
book
,
db
.
Languages
join
=
db
.
books_languages_link
,
db
.
Books
.
id
==
db
.
books_languages_link
.
c
.
book
,
db
.
Languages
elif
order
and
sort
in
[
"sort"
,
"title"
,
"authors_sort"
,
"series_index"
]:
order
=
[
text
(
sort
+
" "
+
order
)]
elif
not
state
:
...
...
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