Compute some stats on shots if used in the edit.
This commit is contained in:
@@ -58,6 +58,14 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
|
||||
# Append the task type onto which 'other' tasks are mapped.
|
||||
task_types = attract_props.task_types.attract_shot + [None]
|
||||
|
||||
# Some aggregated stats
|
||||
stats = {
|
||||
'nr_of_shots': sum(shot.properties.used_in_edit for shot in shots),
|
||||
'total_frame_count': sum(shot.properties.duration_in_edit_in_frames or 0
|
||||
for shot in shots
|
||||
if shot.properties.used_in_edit),
|
||||
}
|
||||
|
||||
return render_template('attract/shots/for_project.html',
|
||||
shots=shots,
|
||||
tasks_for_shots=tasks_for_shots,
|
||||
@@ -65,7 +73,8 @@ def for_project(project, attract_props, task_id=None, shot_id=None):
|
||||
open_task_id=task_id,
|
||||
open_shot_id=shot_id,
|
||||
project=project,
|
||||
attract_props=attract_props)
|
||||
attract_props=attract_props,
|
||||
stats=stats)
|
||||
|
||||
|
||||
@perproject_blueprint.route('/<shot_id>')
|
||||
|
Reference in New Issue
Block a user