fix(pres_mgmt): show session/presenter counts in File Downloads header

The summary was showing file counts by type (session-level files vs
presenter-level files), which made the session count look wrong (e.g.
6 when there are 40 sessions). Now shows unique session and presenter
counts from the grouped data, matching what the label implies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-10 17:30:19 -04:00
parent 666b54bd36
commit 246d4f8ef3

View File

@@ -259,8 +259,8 @@ let session_groups = $derived.by((): SessionGroup[] => {
return sorted; return sorted;
}); });
let total_session_files = $derived(session_groups.reduce((n, sg) => n + sg.session_files.length, 0)); let total_sessions = $derived(session_groups.length);
let total_presenter_files = $derived(session_groups.reduce((n, sg) => sg.presenter_groups.reduce((m, pg) => m + pg.files.length, 0) + n, 0)); let total_presenters = $derived(session_groups.reduce((n, sg) => n + sg.presenter_groups.length, 0));
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Query // Query
@@ -330,7 +330,7 @@ async function handle_qry() {
<span class="badge preset-tonal-surface text-sm">{qry__count} files</span> <span class="badge preset-tonal-surface text-sm">{qry__count} files</span>
{/if} {/if}
<span class="text-sm font-normal opacity-60"> <span class="text-sm font-normal opacity-60">
&nbsp;({total_session_files} session &nbsp;/ {total_presenter_files} presenter) &nbsp;({total_sessions} session{total_sessions !== 1 ? 's' : ''} &nbsp;/ {total_presenters} presenter{total_presenters !== 1 ? 's' : ''})
</span> </span>
</h3> </h3>