-
-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Bug Description
The "Now Playing" / "Activity" section shows "No playback found" even when there are active sessions streaming content. The browser console shows:
TypeError: Cannot read properties of undefined (reading 'toUpperCase')
Root Cause
In the minified frontend code (/app/frontend/dist/assets/index-6d3878d7.js), around position 24900-25300, there's code that calls .toUpperCase() on Container fields without null checks:
a=o=>{
let g="";
return o.TranscodingInfo && (g=` -> ${o.TranscodingInfo.Container.toUpperCase()}`),
`${o.NowPlayingItem.Container.toUpperCase()}${g}`
}When a session doesn't have an active NowPlayingItem or TranscodingInfo, or when these objects exist but Container is undefined, the code crashes.
Additionally, PlayState.PlayMethod can be undefined for idle sessions.
Affected Version
Jellystat v1.1.7
Workaround / Proposed Fix
Add data sanitization in ActivityMonitor.js before sending session data to the frontend via WebSocket:
function sanitizeSessionData(sessions) {
if (!Array.isArray(sessions)) return [];
return sessions.map(session => ({
...session,
Client: session.Client || "",
DeviceName: session.DeviceName || "",
UserName: session.UserName || "",
PlayState: session.PlayState
? { ...session.PlayState, PlayMethod: session.PlayState.PlayMethod || "" }
: { PlayMethod: "", IsPaused: false },
NowPlayingItem: session.NowPlayingItem
? { ...session.NowPlayingItem, Container: session.NowPlayingItem.Container || "" }
: null,
TranscodingInfo: session.TranscodingInfo
? { ...session.TranscodingInfo, Container: session.TranscodingInfo.Container || "" }
: null
}));
}Then use it before sending updates:
sendUpdate("sessions", sanitizeSessionData(apiSessionData));Alternatively, fix the frontend to add null checks before calling .toUpperCase().
Steps to Reproduce
- Have multiple Jellyfin clients connected (some actively playing, some idle)
- Open Jellystat dashboard
- Check browser console for TypeError
- "Now Playing" section shows no playback even though streams are active