mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
calibredb: Handle the case when the user specifies the same to delete id multiple times
This commit is contained in:
parent
a3ff5086bd
commit
39fc7f0cf6
@ -386,7 +386,7 @@ def command_remove(args, dbpath):
|
||||
else:
|
||||
ids.append(int(y[0]))
|
||||
|
||||
do_remove(get_db(dbpath, opts), ids)
|
||||
do_remove(get_db(dbpath, opts), set(ids))
|
||||
|
||||
return 0
|
||||
|
||||
|
@ -921,9 +921,12 @@ class LibraryDatabase2(LibraryDatabase):
|
||||
'''
|
||||
Removes book from the result cache and the underlying database.
|
||||
'''
|
||||
try:
|
||||
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
|
||||
except:
|
||||
path = None
|
||||
self.data.remove(id)
|
||||
if os.path.exists(path):
|
||||
if path and os.path.exists(path):
|
||||
try:
|
||||
winshell.delete_file(path, no_confirm=True, silent=True)
|
||||
except:
|
||||
|
Loading…
x
Reference in New Issue
Block a user