Show TeamSpeak 6's own viewer counts for streams
The streams list and the watch screen showed how many watch a stream only when a gateway's directory knew it, although TeamSpeak 6 tells the count itself: `viewer` in `notifystreaminfo`. StreamInfo gets `viewers`: the server's count from `notifystreaminfo`, 0 for a stream that just started. Probed on the dev server, the server sends `notifystreamclientjoined` to the whole channel but `notifystreamclientleft` only to the streamer and the viewer who left, and no `notifystreamupdated` for either; so the directory counts joins and leaves itself and the engine asks `requeststreaminfo` again, one stream of another client every 5 s round robin, which corrects the leaves it was not told about without flooding the server however many stream. The app shows that count, and the gateway's where the server gave none; `voelinctl stream list` prints it. Against the TeamSpeak 6 dev server, a late `stream list` printed "1 watching" while a viewer watched and "0 watching" after it left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8519199c6b
commit
23bf7331c4
12 files changed
+150
-7
No files matched your search
@@ -694,13 +694,14 @@ async fn list(con: &mut Connection, driver: &mut Driver, settle: Duration) -> Re
|
||||
let streams: Vec<&StreamInfo> = driver.streams.directory().iter().collect();
|
||||
for s in &streams {
|
||||
println!(
|
||||
"{} {:?} by {} (clid {}), {} kbit/s{}",
|
||||
"{} {:?} by {} (clid {}), {} kbit/s{}{}",
|
||||
s.id,
|
||||
s.name,
|
||||
nick(con, s.streamer),
|
||||
s.streamer.0,
|
||||
s.bitrate,
|
||||
if s.audio { ", audio" } else { "" }
|
||||
if s.audio { ", audio" } else { "" },
|
||||
s.viewers.map(|n| format!(", {n} watching")).unwrap_or_default()
|
||||
);
|
||||
}
|
||||
// Streamers in our channel known only by the flag: the lookup failed or
|
||||
|
||||
Reference in new issue
Block a user