Feat : Handling idle state
All checks were successful
release / build (push) Successful in 25s
release / verify-windows (push) Successful in 1m14s

This commit is contained in:
jeanotx32
2026-08-11 23:31:26 +02:00
parent 2380196169
commit 242bbf1383
6 changed files with 108 additions and 11 deletions

View File

@@ -218,7 +218,11 @@ function WatchStrip({
onCheck: () => void;
onFullscreen: () => void;
}) {
const info = WATCH_LABELS[watch.state];
// Même nuance que sur la page Streamers : « revient bientôt » n'est pas un show privé.
const info =
watch.state === 'private' && watch.rawStatus === 'idle'
? { text: 'revient bientôt', tone: 'warn' }
: WATCH_LABELS[watch.state];
const stale = watch.lastCheckedAt > 0 && Date.now() - watch.lastCheckedAt > 60_000;
return (

View File

@@ -508,8 +508,11 @@ export function AgentSettings({ agent, targets, onClose, onCommand, notify }: Pr
}
/>
<span className="muted small">
Statuts renvoyés par Stripchat : public, private, p2p, groupShow, idle. Retire
groupShow si tu veux continuer à enregistrer les shows de groupe.
Statuts renvoyés par Stripchat : public, private, p2p, groupShow,
virtualPrivate, ticketShow, idle, off. Ceux listés ici mettent en pause sans
clore. <strong>idle</strong> est le « revient bientôt » : le streamer est
connecté mais ne diffuse pas. Retire groupShow pour continuer à enregistrer
les shows de groupe.
</span>
</label>

View File

@@ -10,6 +10,18 @@ const STATE_LABELS: Record<StreamState, { text: string; tone: string }> = {
unknown: { text: '…', tone: 'offline' },
};
/**
* `idle` et `private` partagent le même état normalisé — les deux mettent
* l'enregistrement en pause sans le clore — mais ne veulent pas dire la même
* chose à l'écran : le premier est une absence, le second un show payant.
*/
function stateLabel(target: WatchTarget): { text: string; tone: string } {
if (target.state === 'private' && target.rawStatus === 'idle') {
return { text: 'revient bientôt', tone: 'warn' };
}
return STATE_LABELS[target.state];
}
interface Props {
targets: WatchTarget[];
agents: AgentView[];
@@ -114,7 +126,7 @@ function StreamerCard({
const [busy, setBusy] = useState(false);
const [avatarBroken, setAvatarBroken] = useState(false);
const state = STATE_LABELS[target.state];
const state = stateLabel(target);
const agent = agents.find((candidate) => candidate.id === target.agentId) ?? null;
const recording = agent?.status.recording ?? false;
const isLive = target.state === 'public';
@@ -171,7 +183,9 @@ function StreamerCard({
<span className="muted small">@{target.username}</span>
</div>
<span className={`badge ${state.tone}`}>{state.text}</span>
<span className={`badge ${state.tone}`} title={`statut brut « ${target.rawStatus ?? '?'} »`}>
{state.text}
</span>
</header>
<dl className="streamer-facts">