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
b2594468
Unverified
Commit
b2594468
authored
Oct 17, 2020
by
celogeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add helper to get all read books
parent
754b9832
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
helper.py
cps/helper.py
+15
-0
No files found.
cps/helper.py
View file @
b2594468
...
...
@@ -819,3 +819,18 @@ def get_download_link(book_id, book_format, client):
return
do_download_file
(
book
,
book_format
,
client
,
data1
,
headers
)
else
:
abort
(
404
)
def
get_readbooks_ids
():
if
not
config
.
config_read_column
:
readBooks
=
ub
.
session
.
query
(
ub
.
ReadBook
)
.
filter
(
ub
.
ReadBook
.
user_id
==
int
(
current_user
.
id
))
\
.
filter
(
ub
.
ReadBook
.
is_read
==
True
)
.
all
()
return
frozenset
([
x
.
book_id
for
x
in
readBooks
])
else
:
try
:
readBooks
=
calibre_db
.
session
.
query
(
db
.
cc_classes
[
config
.
config_read_column
])
\
.
filter
(
db
.
cc_classes
[
config
.
config_read_column
]
.
value
==
True
)
.
all
()
return
frozenset
([
x
.
book
for
x
in
readBooks
])
except
KeyError
:
log
.
error
(
"Custom Column No.
%
d is not existing in calibre database"
,
config
.
config_read_column
)
return
[]
\ No newline at end of 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