mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
flame: ignore clip file with zero lines
This commit is contained in:
parent
08f80ecf15
commit
34a65cb646
1 changed files with 14 additions and 1 deletions
|
|
@ -708,19 +708,32 @@ class OpenClipSolver:
|
|||
self.feed_dir = os.path.dirname(feed_path)
|
||||
self.feed_ext = os.path.splitext(self.feed_basename)[1][1:].lower()
|
||||
|
||||
if not os.path.isfile(openclip_file_path):
|
||||
if not self._is_valid_tmp_file(openclip_file_path):
|
||||
# openclip does not exist yet and will be created
|
||||
self.tmp_file = self.out_file = openclip_file_path
|
||||
self.create_new_clip = True
|
||||
|
||||
else:
|
||||
# update already created clip
|
||||
# output a temp file
|
||||
self.out_file = openclip_file_path
|
||||
self.tmp_file = os.path.join(self.feed_dir, self.tmp_name)
|
||||
|
||||
# remove previously generated temp files
|
||||
# it will be regenerated
|
||||
self._clear_tmp_file()
|
||||
|
||||
self.log.info("Temp File: {}".format(self.tmp_file))
|
||||
|
||||
def _is_valid_tmp_file(self, file):
|
||||
# check if file exists
|
||||
if os.path.isfile(file):
|
||||
with open(self.tmp_file) as f:
|
||||
lines = f.readlines()
|
||||
if len(lines) < 1:
|
||||
self._clear_tmp_file()
|
||||
return False
|
||||
|
||||
def make(self):
|
||||
self._generate_media_info_file()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue