{# Episode audio status badge + inline probe button. Context variables ----------------- ep — Episode object pe — ProbeEntry | None (from report.probe.get(ep.guid)) slug — show slug (needed for the probe form) ep_id — CSS-safe id string for this row's status span, e.g. "ep-status-" Callers must pre-compute this and pass it in so that both the initial table render and the inline probe response use the same id. Three states ------------ ok → green "OK" (pe exists and pe.ok is True) invalid → red "invalid audio" (pe exists, pe.ok is False, error is NOT just unreachable) unverified → yellow "audio unverified" (no pe, or pe.ok is False due to unreachability) "invalid audio" means we positively know the file is bad (wrong format, drift, mutagen error). "audio unverified" means we simply don't have a fresh successful probe yet — could be transient. Both states show a small "Probe" button for convenience. #} {%- set needs_button = not (pe and pe.ok) -%} {%- set is_hard_failure = pe and not pe.ok and pe.error and 'unreachable' not in pe.error and 'audio-error' not in pe.error -%} {%- if pe and pe.ok -%} OK {%- elif is_hard_failure -%} audio invalid {%- else -%} audio unverified {%- endif -%} {%- if needs_button -%}
{%- endif -%}