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
c80e517c
Commit
c80e517c
authored
Apr 15, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete books prepared for deleting on doogle drive
parent
195e581a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
helper.py
cps/helper.py
+3
-0
web.py
cps/web.py
+4
-1
No files found.
cps/helper.py
View file @
c80e517c
...
@@ -277,6 +277,9 @@ def delete_book(book, calibrepath):
...
@@ -277,6 +277,9 @@ def delete_book(book, calibrepath):
path
=
os
.
path
.
join
(
calibrepath
,
book
.
path
)
#.replace('/',os.path.sep)).replace('\\',os.path.sep)
path
=
os
.
path
.
join
(
calibrepath
,
book
.
path
)
#.replace('/',os.path.sep)).replace('\\',os.path.sep)
shutil
.
rmtree
(
path
,
ignore_errors
=
True
)
shutil
.
rmtree
(
path
,
ignore_errors
=
True
)
def
delete_book_gdrive
(
book
):
pass
def
update_dir_stucture
(
book_id
,
calibrepath
):
def
update_dir_stucture
(
book_id
,
calibrepath
):
db
.
session
.
connection
()
.
connection
.
connection
.
create_function
(
"title_sort"
,
1
,
db
.
title_sort
)
db
.
session
.
connection
()
.
connection
.
connection
.
create_function
(
"title_sort"
,
1
,
db
.
title_sort
)
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
...
...
cps/web.py
View file @
c80e517c
...
@@ -1290,7 +1290,10 @@ def delete_book(book_id):
...
@@ -1290,7 +1290,10 @@ def delete_book(book_id):
if
current_user
.
role_delete_books
():
if
current_user
.
role_delete_books
():
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book_id
)
.
first
()
if
book
:
if
book
:
helper
.
delete_book
(
book
,
config
.
config_calibre_dir
)
if
config
.
config_use_google_drive
:
helper
.
delete_book_gdrive
(
book
)
# ToDo really delete file
else
:
helper
.
delete_book
(
book
,
config
.
config_calibre_dir
)
# check if only this book links to:
# check if only this book links to:
# author, language, series, tags, custom columns
# author, language, series, tags, custom columns
modify_database_object
([
u''
],
book
.
authors
,
db
.
Authors
,
db
.
session
,
'author'
)
modify_database_object
([
u''
],
book
.
authors
,
db
.
Authors
,
db
.
session
,
'author'
)
...
...
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