[pp:ugoira] support '"keep-files": true' + custom extension (#7304)
for '"mode": "archive"'
This commit is contained in:
@@ -135,7 +135,7 @@ class UgoiraPP(PostProcessor):
|
|||||||
if not self._convert_zip:
|
if not self._convert_zip:
|
||||||
return
|
return
|
||||||
self._zip_source = True
|
self._zip_source = True
|
||||||
ext = pathfmt.extension
|
self._zip_ext = ext = pathfmt.extension
|
||||||
|
|
||||||
with self._tempdir() as tempdir:
|
with self._tempdir() as tempdir:
|
||||||
if tempdir:
|
if tempdir:
|
||||||
@@ -255,9 +255,15 @@ class UgoiraPP(PostProcessor):
|
|||||||
]).encode()
|
]).encode()
|
||||||
|
|
||||||
if self._zip_source:
|
if self._zip_source:
|
||||||
self.delete = False
|
zpath = pathfmt.temppath
|
||||||
|
if self.delete:
|
||||||
|
self.delete = False
|
||||||
|
elif self._zip_ext != self.extension:
|
||||||
|
self._copy_file(zpath, pathfmt.realpath)
|
||||||
|
zpath = pathfmt.realpath
|
||||||
|
|
||||||
if self.metadata:
|
if self.metadata:
|
||||||
with zipfile.ZipFile(pathfmt.temppath, "a") as zfile:
|
with zipfile.ZipFile(zpath, "a") as zfile:
|
||||||
zinfo = zipfile.ZipInfo(metaname)
|
zinfo = zipfile.ZipInfo(metaname)
|
||||||
if self.mtime:
|
if self.mtime:
|
||||||
zinfo.date_time = zfile.infolist()[0].date_time
|
zinfo.date_time = zfile.infolist()[0].date_time
|
||||||
|
|||||||
Reference in New Issue
Block a user