[pp:rename] recheck if file exists only when necessary
This commit is contained in:
@@ -322,7 +322,7 @@ class DownloadJob(Job):
|
|||||||
for callback in hooks["prepare-after"]:
|
for callback in hooks["prepare-after"]:
|
||||||
callback(pathfmt)
|
callback(pathfmt)
|
||||||
|
|
||||||
if pathfmt.exists():
|
if kwdict.pop("_file_recheck", False) and pathfmt.exists():
|
||||||
if archive and self._archive_write_skip:
|
if archive and self._archive_write_skip:
|
||||||
archive.add(kwdict)
|
archive.add(kwdict)
|
||||||
self.handle_skip()
|
self.handle_skip()
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class RenamePP(PostProcessor):
|
|||||||
pathfmt.filename = name_new = self._new(pathfmt)
|
pathfmt.filename = name_new = self._new(pathfmt)
|
||||||
pathfmt.path = pathfmt.directory + name_new
|
pathfmt.path = pathfmt.directory + name_new
|
||||||
pathfmt.realpath = pathfmt.realdirectory + name_new
|
pathfmt.realpath = pathfmt.realdirectory + name_new
|
||||||
|
pathfmt.kwdict["_file_recheck"] = True
|
||||||
|
|
||||||
def _rename(self, path_old, name_old, path_new, name_new):
|
def _rename(self, path_old, name_old, path_new, name_new):
|
||||||
if self.skip and os.path.exists(path_new):
|
if self.skip and os.path.exists(path_new):
|
||||||
|
|||||||
Reference in New Issue
Block a user