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
eaed53e2
Commit
eaed53e2
authored
Sep 05, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for author edit error (2 same sort_authors lead maybe to choose wrong one)
parent
feacbe8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
db.py
cps/db.py
+6
-3
editbooks.py
cps/editbooks.py
+1
-0
No files found.
cps/db.py
View file @
eaed53e2
...
...
@@ -593,13 +593,16 @@ class CalibreDB():
sort_authors
=
entry
.
author_sort
.
split
(
'&'
)
authors_ordered
=
list
()
error
=
False
ids
=
[
a
.
id
for
a
in
entry
.
authors
]
for
auth
in
sort_authors
:
results
=
self
.
session
.
query
(
Authors
)
.
filter
(
Authors
.
sort
==
auth
.
lstrip
()
.
strip
())
.
all
()
# ToDo: How to handle not found authorname
result
=
self
.
session
.
query
(
Authors
)
.
filter
(
Authors
.
sort
==
auth
.
lstrip
()
.
strip
())
.
first
()
if
not
result
:
if
not
len
(
results
):
error
=
True
break
authors_ordered
.
append
(
result
)
for
r
in
results
:
if
r
.
id
in
ids
:
authors_ordered
.
append
(
r
)
if
not
error
:
entry
.
authors
=
authors_ordered
return
entry
...
...
cps/editbooks.py
View file @
eaed53e2
...
...
@@ -684,6 +684,7 @@ def edit_book(book_id):
if
modif_date
:
book
.
last_modified
=
datetime
.
utcnow
()
calibre_db
.
session
.
merge
(
book
)
calibre_db
.
session
.
commit
()
if
config
.
config_use_google_drive
:
gdriveutils
.
updateGdriveCalibreFromLocal
()
...
...
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