Add clip pinning test coverage

This commit is contained in:
Codex
2026-04-22 08:33:47 -05:00
parent 0a13aedbef
commit 58efca9a9f
9 changed files with 124 additions and 6 deletions

View File

@@ -131,11 +131,11 @@ export const api = {
throw new Error(await response.text());
}
},
listClips: (teamId: string, playerId?: string) =>
listClips: (teamId: string, playerId?: string, includeHidden = false) =>
request<AudioClip[]>(
`/media/clips?external_team_id=${encodeURIComponent(teamId)}${
playerId ? `&owner_external_player_id=${encodeURIComponent(playerId)}` : ""
}`,
}${includeHidden ? "&include_hidden=true" : ""}`,
),
createClip: (payload: {
asset_id: number;

View File

@@ -47,6 +47,7 @@ export interface AudioClip {
start_ms: number;
end_ms: number;
sort_order: number;
hidden: boolean;
normalization_status: string;
normalized_url?: string | null;
waveform_duration_ms?: number | null;
@@ -59,6 +60,7 @@ export interface AudioClipUpdate {
end_ms: number;
label?: string;
sort_order?: number | null;
hidden?: boolean | null;
}
export interface GameAssignment {

View File

@@ -30,7 +30,7 @@ export function GamePage() {
}, [searchParams, selectedGameId, walkup.nextGame]);
const clipsQuery = useQuery({
queryKey: ["clips", teamId, playerId],
queryKey: ["clips", teamId, playerId, "visible"],
queryFn: () => api.listClips(teamId, playerId),
enabled: Boolean(teamId && playerId),
});

View File

@@ -653,7 +653,7 @@ function LibraryClips({
pinnedAssignmentsByClipId: Map<string, GameAssignment>;
}) {
const fallbackClipsQuery = useQuery({
queryKey: ["clips", teamId, playerId],
queryKey: ["clips", teamId, playerId, "visible"],
queryFn: () => api.listClips(teamId, playerId),
enabled: Boolean(teamId && playerId),
});