{% extends "base.html" %} {% block title %}Lectures — CLM Recordings{% endblock %} {% block content %}

Lectures

{# Hidden listener: OBS state changes re-fetch the dynamic content so the banner appears/disappears and Record/Arm buttons toggle their disabled attribute without a manual reload. Subscribing to `job` as well keeps the deck-status column in sync when Auphonic jobs finish — without it the row badge stays stuck at "processing" until the user reloads. #}
{% if not snapshot.obs_connected %} {% endif %}
{% if snapshot.armed_deck %} {% endif %} {% if error %} {% endif %} {% for section in sections %}

{{ section.name }}

{% for deck in section.decks %} {% set is_armed = snapshot.armed_deck and snapshot.armed_deck.deck_name == deck.deck_name and snapshot.armed_deck.section_name == section.name %} {% set armed_part = snapshot.armed_deck.part_number if is_armed else 0 %} {% set has_existing_parts = deck.status and deck.status.parts_status %} {% set unprocessed_count = deck.status.raw_parts | length if deck.status else 0 %} {% endfor %}
Deck Status Actions
{{ deck.display_name }} {% if is_armed and snapshot.state.value in ('recording', 'paused') %} {% if snapshot.state.value == 'paused' %} paused {% else %} recording {% endif %} {% if snapshot.recording_elapsed_seconds is not none %} {{ '%d:%02d' | format( (snapshot.recording_elapsed_seconds | int) // 60, (snapshot.recording_elapsed_seconds | int) % 60 ) }} {% endif %} {% endif %} {# Per-part chip strip — replaces the old free-form part_number input. The chip strip itself is the part selector; action buttons in the next column read its selection from sessionStorage. #} {% include "partials/parts.html" %} {# Failed-retry indicator stays at the row level so the user notices the deck even if no chips are in the failed state. #} {% if deck.status and deck.status.failed_job_id and deck.status.state.value != 'failed' %} processing failed {% endif %}
{% if is_armed and snapshot.state.value == 'recording' %}
{% elif is_armed and snapshot.state.value == 'paused' %}
{% else %} {# Shared form: two submit buttons, one per action. The hidden ``part_number`` input is populated by the chip JS in base.html on every chip click and again right before submit. Default is 0 (unsuffixed first take) — matches the previous form's default. #}
{% if is_armed %}
{% endif %} {% endif %} {% if deck.status and deck.status.state.value in ('recorded', 'failed') and deck.status.raw_paths %} {# Per-chip Process: submits the raw path of the selected chip's part. The hidden input is rewritten by the chip JS on every selection change. #}
{# Default raw_path = first known raw; overwritten on selection change. #} {% for rp in deck.status.raw_paths %} {% endfor %}
{% if unprocessed_count > 1 %} {# Process all: fire-and-forget batch submit that ignores chip selection. #}
{% for rp in deck.status.raw_paths %} {% endfor %}
{% endif %}
{% elif deck.status and deck.status.state.value == 'processing' %} processing… {% endif %}
{% endfor %} {% if not sections and not error %}

No sections found in the course.

{% endif %}
{# /#lectures-dynamic #} {% endblock %}