mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix retiring a note with a resource throwing an error if a version of the note with the same resource is already retired
This commit is contained in:
parent
b9dcc6ee85
commit
07a77403a8
@ -172,7 +172,8 @@ class Notes:
|
|||||||
rpath = make_long_path_useable(self.path_for_resource(rhash))
|
rpath = make_long_path_useable(self.path_for_resource(rhash))
|
||||||
if os.path.exists(rpath):
|
if os.path.exists(rpath):
|
||||||
rdest = os.path.join(destdir, 'res-'+rname)
|
rdest = os.path.join(destdir, 'res-'+rname)
|
||||||
copyfile_using_links(rpath, make_long_path_useable(rdest), dest_is_dir=False)
|
with suppress(shutil.SameFileError):
|
||||||
|
copyfile_using_links(rpath, make_long_path_useable(rdest), dest_is_dir=False)
|
||||||
self.trim_retired_dir()
|
self.trim_retired_dir()
|
||||||
|
|
||||||
def unretire(self, conn, field_name, item_id, item_value) -> int:
|
def unretire(self, conn, field_name, item_id, item_value) -> int:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user