write skipped files to archive (closes #550)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user