mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[pp:rename] recheck if file exists only when necessary
This commit is contained in:
parent
359572162b
commit
8072dcf717
@ -322,7 +322,7 @@ class DownloadJob(Job):
|
||||
for callback in hooks["prepare-after"]:
|
||||
callback(pathfmt)
|
||||
|
||||
if pathfmt.exists():
|
||||
if kwdict.pop("_file_recheck", False) and pathfmt.exists():
|
||||
if archive and self._archive_write_skip:
|
||||
archive.add(kwdict)
|
||||
self.handle_skip()
|
||||
|
@ -64,6 +64,7 @@ class RenamePP(PostProcessor):
|
||||
pathfmt.filename = name_new = self._new(pathfmt)
|
||||
pathfmt.path = pathfmt.directory + name_new
|
||||
pathfmt.realpath = pathfmt.realdirectory + name_new
|
||||
pathfmt.kwdict["_file_recheck"] = True
|
||||
|
||||
def _rename(self, path_old, name_old, path_new, name_new):
|
||||
if self.skip and os.path.exists(path_new):
|
||||
|
Loading…
Reference in New Issue
Block a user