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
ca2bcc64
Unverified
Commit
ca2bcc64
authored
Apr 19, 2020
by
celogeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle read config
Allow advance search Remove duplicate status on show
parent
902685a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
helper.py
cps/helper.py
+12
-8
web.py
cps/web.py
+1
-1
No files found.
cps/helper.py
View file @
ca2bcc64
...
@@ -804,16 +804,20 @@ def get_search_results(term):
...
@@ -804,16 +804,20 @@ def get_search_results(term):
func
.
lower
(
db
.
Books
.
title
)
.
ilike
(
"
%
"
+
term
+
"
%
"
)
func
.
lower
(
db
.
Books
.
title
)
.
ilike
(
"
%
"
+
term
+
"
%
"
)
))
.
all
()
))
.
all
()
def
get_cc_columns
():
def
get_cc_columns
(
filter_config_custom_read
=
False
):
tmpcc
=
db
.
session
.
query
(
db
.
Custom_Columns
)
.
filter
(
db
.
Custom_Columns
.
datatype
.
notin_
(
db
.
cc_exceptions
))
.
all
()
tmpcc
=
db
.
session
.
query
(
db
.
Custom_Columns
)
.
filter
(
db
.
Custom_Columns
.
datatype
.
notin_
(
db
.
cc_exceptions
))
.
all
()
cc
=
[]
r
=
None
if
config
.
config_columns_to_ignore
:
if
config
.
config_columns_to_ignore
:
cc
=
[]
r
=
re
.
compile
(
config
.
config_columns_to_ignore
)
for
col
in
tmpcc
:
r
=
re
.
compile
(
config
.
config_columns_to_ignore
)
for
col
in
tmpcc
:
if
not
r
.
match
(
col
.
name
):
if
filter_config_custom_read
and
config
.
config_read_column
and
config
.
config_read_column
==
col
.
id
:
cc
.
append
(
col
)
continue
else
:
if
r
and
r
.
match
(
col
.
label
):
cc
=
tmpcc
continue
cc
.
append
(
col
)
return
cc
return
cc
def
get_download_link
(
book_id
,
book_format
):
def
get_download_link
(
book_id
,
book_format
):
...
...
cps/web.py
View file @
ca2bcc64
...
@@ -1529,7 +1529,7 @@ def show_book(book_id):
...
@@ -1529,7 +1529,7 @@ def show_book(book_id):
except
UnknownLocaleError
:
except
UnknownLocaleError
:
entries
.
languages
[
index
]
.
language_name
=
_
(
entries
.
languages
[
index
]
.
language_name
=
_
(
isoLanguages
.
get
(
part3
=
entries
.
languages
[
index
]
.
lang_code
)
.
name
)
isoLanguages
.
get
(
part3
=
entries
.
languages
[
index
]
.
lang_code
)
.
name
)
cc
=
get_cc_columns
()
cc
=
get_cc_columns
(
filter_config_custom_read
=
True
)
book_in_shelfs
=
[]
book_in_shelfs
=
[]
shelfs
=
ub
.
session
.
query
(
ub
.
BookShelf
)
.
filter
(
ub
.
BookShelf
.
book_id
==
book_id
)
.
all
()
shelfs
=
ub
.
session
.
query
(
ub
.
BookShelf
)
.
filter
(
ub
.
BookShelf
.
book_id
==
book_id
)
.
all
()
for
entry
in
shelfs
:
for
entry
in
shelfs
:
...
...
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