Staff playtime figures on the staff panel only

Signed-in staff now see the public Playtime page and player drawers as
everyone else does; the staff panels, names, sessions and locations stay
on /admin#playtime and its drawers. The public API no longer sends them.
This commit is contained in:
Astra 2026-10-05 12:35:14 +01:00
parent ba61708bed
commit 9aeea45130
5 changed files with 22 additions and 23 deletions

View file

@ -292,13 +292,9 @@ func (s *Server) publicPlayer(w http.ResponseWriter, r *http.Request) {
"steamid": steamid, "name": d.Name, "online": online, "rank": s.rankOf(x, steamid),
"bans": toPublic(bans), "comms": toPublic(comms),
}
// Signed-in staff get the staff playtime figures here too, as on the staff panel.
id, _, err := s.identity(r)
if err != nil {
internal(w, r, err)
return
}
if pt := s.playerPlaytime(r, steamid, s.ptStaff(r.Context(), id)); pt != nil {
// Everyone gets the public playtime here, signed-in staff included; the staff figures are on
// the staff panel only.
if pt := s.playerPlaytime(r, steamid, false); pt != nil {
resp["playtime"] = pt
}
writeJSON(w, http.StatusOK, resp)