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
6f9c08f9
Commit
6f9c08f9
authored
May 24, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo RarExecutable
parent
70c666c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
editbooks.py
cps/editbooks.py
+11
-6
No files found.
cps/editbooks.py
View file @
6f9c08f9
...
...
@@ -448,8 +448,11 @@ def edit_cc_data(book_id, book, to_save):
else
:
input_tags
=
to_save
[
cc_string
]
.
split
(
','
)
input_tags
=
list
(
map
(
lambda
it
:
it
.
strip
(),
input_tags
))
changed
|=
modify_database_object
(
input_tags
,
getattr
(
book
,
cc_string
),
db
.
cc_classes
[
c
.
id
],
calibre_db
.
session
,
'custom'
)
changed
|=
modify_database_object
(
input_tags
,
getattr
(
book
,
cc_string
),
db
.
cc_classes
[
c
.
id
],
calibre_db
.
session
,
'custom'
)
return
changed
def
upload_single_file
(
request
,
book
,
book_id
):
...
...
@@ -510,7 +513,7 @@ def upload_single_file(request, book, book_id):
return
uploader
.
process
(
saved_filename
,
*
os
.
path
.
splitext
(
requested_file
.
filename
),
rarEx
c
ecutable
=
config
.
config_rarfile_location
)
rarExecutable
=
config
.
config_rarfile_location
)
def
upload_cover
(
request
,
book
):
...
...
@@ -805,16 +808,18 @@ def upload():
# handle series
modif_date
|=
edit_book_series
(
meta
.
series
,
db_book
)
#
flush content, get db_book.id available
#
Add file to book
file_size
=
os
.
path
.
getsize
(
saved_filename
)
db_data
=
db
.
Data
(
db_book
,
meta
.
extension
.
upper
()[
1
:],
file_size
,
title_dir
)
db_book
.
data
.
append
(
db_data
)
calibre_db
.
session
.
add
(
db_book
)
# flush content, get db_book.id available
calibre_db
.
session
.
flush
()
# Comments needs book id therfore only possiblw after flush
modif_date
|=
edit_book_comments
(
Markup
(
meta
.
description
)
.
unescape
(),
db_book
)
calibre_db
.
session
.
add
(
db_book
)
calibre_db
.
session
.
flush
()
book_id
=
db_book
.
id
title
=
db_book
.
title
...
...
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