write skipped files to archive (closes #550)

This commit is contained in:
Mike Fährmann
2020-09-03 18:37:38 +02:00
parent ac3036ef56
commit b5243297ff
2 changed files with 12 additions and 5 deletions

View File

@@ -224,7 +224,14 @@ class DownloadJob(Job):
for pp in postprocessors:
pp.prepare(pathfmt)
if pathfmt.exists(archive):
if archive and kwdict in archive:
pathfmt.fix_extension()
self.handle_skip()
return
if pathfmt.exists():
if archive:
archive.add(kwdict)
self.handle_skip()
return
@@ -248,6 +255,8 @@ class DownloadJob(Job):
return
if not pathfmt.temppath:
if archive:
archive.add(kwdict)
self.handle_skip()
return

View File

@@ -769,10 +769,8 @@ class PathFormat():
"""Open file and return a corresponding file object"""
return open(self.temppath, mode)
def exists(self, archive=None):
"""Return True if the file exists on disk or in 'archive'"""
if archive and self.kwdict in archive:
return self.fix_extension()
def exists(self):
"""Return True if the file exists on disk"""
if self.extension and os.path.exists(self.realpath):
return self.check_file()
return False