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
e2924777
Commit
e2924777
authored
Sep 12, 2020
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes for uploading books to GDrive with new worker
parent
b202ca56
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
447 additions
and
202 deletions
+447
-202
editbooks.py
cps/editbooks.py
+2
-5
gdriveutils.py
cps/gdriveutils.py
+2
-2
helper.py
cps/helper.py
+2
-2
Calibre-Web TestSummary_Linux.html
test/Calibre-Web TestSummary_Linux.html
+441
-193
No files found.
cps/editbooks.py
View file @
e2924777
...
...
@@ -848,7 +848,7 @@ def upload():
book_id
=
db_book
.
id
title
=
db_book
.
title
error
=
helper
.
update_dir_st
uctur
e
(
book_id
,
error
=
helper
.
update_dir_st
ructure_fil
e
(
book_id
,
config
.
config_calibre_dir
,
input_authors
[
0
],
meta
.
file_path
,
...
...
@@ -872,10 +872,7 @@ def upload():
# save data to database, reread data
calibre_db
.
session
.
commit
()
#calibre_db.setup_db(config, ub.app_DB_path)
# Reread book. It's important not to filter the result, as it could have language which hide it from
# current users view (tags are not stored/extracted from metadata and could also be limited)
#book = calibre_db.get_book(book_id)
if
config
.
config_use_google_drive
:
gdriveutils
.
updateGdriveCalibreFromLocal
()
if
error
:
...
...
cps/gdriveutils.py
View file @
e2924777
...
...
@@ -213,7 +213,7 @@ def listRootFolders():
def
getEbooksFolder
(
drive
):
return
getFolderInFolder
(
'root'
,
config
.
config_google_drive_folder
,
drive
)
return
getFolderInFolder
(
'root'
,
config
.
config_google_drive_folder
,
drive
)
def
getFolderInFolder
(
parentId
,
folderName
,
drive
):
...
...
@@ -243,7 +243,7 @@ def getEbooksFolderId(drive=None):
gDriveId
.
path
=
'/'
session
.
merge
(
gDriveId
)
session
.
commit
()
return
return
gDriveId
.
gdrive_id
def
getFile
(
pathId
,
fileName
,
drive
):
...
...
cps/helper.py
View file @
e2924777
...
...
@@ -414,7 +414,7 @@ def update_dir_structure_file(book_id, calibrepath, first_author, orignal_filepa
src
=
new_path
,
dest
=
new_name
,
error
=
str
(
ex
))
return
False
def
update_dir_structure_gdrive
(
book_id
,
first_author
,
original_filepath
):
def
update_dir_structure_gdrive
(
book_id
,
first_author
):
error
=
False
book
=
calibre_db
.
get_book
(
book_id
)
path
=
book
.
path
...
...
@@ -518,7 +518,7 @@ def uniq(inpt):
def
update_dir_stucture
(
book_id
,
calibrepath
,
first_author
=
None
,
orignal_filepath
=
None
,
db_filename
=
None
):
if
config
.
config_use_google_drive
:
return
update_dir_structure_gdrive
(
book_id
,
first_author
,
orignal_filepath
,
db_filename
)
return
update_dir_structure_gdrive
(
book_id
,
first_author
)
else
:
return
update_dir_structure_file
(
book_id
,
calibrepath
,
first_author
,
orignal_filepath
,
db_filename
)
...
...
test/Calibre-Web TestSummary_Linux.html
View file @
e2924777
This diff is collapsed.
Click to expand it.
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