[pp:ugoira] prevent BadZipFile exceptions (#6285)
reset '_convert_…' flags on every 'prepare' event
This commit is contained in:
@@ -105,6 +105,7 @@ class UgoiraPP(PostProcessor):
|
|||||||
}, options)
|
}, options)
|
||||||
|
|
||||||
def prepare(self, pathfmt):
|
def prepare(self, pathfmt):
|
||||||
|
self._convert_zip = self._convert_files = False
|
||||||
if "_ugoira_frame_data" not in pathfmt.kwdict:
|
if "_ugoira_frame_data" not in pathfmt.kwdict:
|
||||||
self._frames = None
|
self._frames = None
|
||||||
return
|
return
|
||||||
@@ -136,7 +137,6 @@ class UgoiraPP(PostProcessor):
|
|||||||
def convert_from_zip(self, pathfmt):
|
def convert_from_zip(self, pathfmt):
|
||||||
if not self._convert_zip:
|
if not self._convert_zip:
|
||||||
return
|
return
|
||||||
self._convert_zip = False
|
|
||||||
self._zip_source = True
|
self._zip_source = True
|
||||||
|
|
||||||
with self._tempdir() as tempdir:
|
with self._tempdir() as tempdir:
|
||||||
@@ -166,7 +166,6 @@ class UgoiraPP(PostProcessor):
|
|||||||
def convert_from_files(self, pathfmt):
|
def convert_from_files(self, pathfmt):
|
||||||
if not self._convert_files:
|
if not self._convert_files:
|
||||||
return
|
return
|
||||||
self._convert_files = False
|
|
||||||
self._zip_source = False
|
self._zip_source = False
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tempdir:
|
with tempfile.TemporaryDirectory() as tempdir:
|
||||||
|
|||||||
Reference in New Issue
Block a user