Initial commit of index html and add ability to delete jobs

This commit is contained in:
Brett Williams
2022-12-07 18:24:02 -08:00
parent cc394932a1
commit fbaf2e3661
7 changed files with 252 additions and 38 deletions

View File

@@ -1,3 +1,4 @@
import glob
import hashlib
import json
import logging
@@ -38,7 +39,7 @@ class RenderJob:
return hashlib.md5(open(self.worker.input_path, 'rb').read()).hexdigest()
return None
def json_safe_copy(self):
def json(self):
"""Converts RenderJob into JSON-friendly dict"""
import numbers
job_dict = None
@@ -97,6 +98,13 @@ class RenderJob:
def frame_count(self):
return self.worker.total_frames
def file_list(self):
job_dir = os.path.dirname(self.worker.output_path)
return glob.glob(os.path.join(job_dir, '*'))
def log_path(self):
return self.worker.log_path
@classmethod
def generate_id(cls):
return str(uuid.uuid4()).split('-')[0]