[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): Guard against null listenedDuration

Fixes #285

FoxxMD (Mar 28, 2025, 8:21 AM EDT) 7c7d710c e2cd7e29

+3 -3
+3 -3
src/client/components/player/Player.tsx
··· 41 41 } = {} 42 42 } = {}, 43 43 play, 44 - listenedDuration, 44 + listenedDuration = 0, 45 45 status: { 46 46 calculated = '???', 47 47 reported, ··· 52 52 53 53 let durPer = null; 54 54 if(duration !== undefined && duration !== null && duration !== 0) { 55 - if(listenedDuration === 0) { 55 + if(listenedDuration === 0 || listenedDuration === null) { 56 56 durPer = ' (0%)'; 57 57 } else { 58 58 durPer = ` (${((listenedDuration/duration) * 100).toFixed(0)}%)`; ··· 97 97 <PlayerTimestamp duration={duration} indeterminate={calculated === 'playing' && data.position === undefined} current={data.position || 0} /> 98 98 <div className="flex"> 99 99 <p className="stats flex-1 text-left">Status: {capitalize(calculated)}</p> 100 - <p className="stats flex-1 text-right">Listened: {calculated !== 'stopped' ? `${listenedDuration.toFixed(0)}s` : '-'}{durPer}</p> 100 + <p className="stats flex-1 text-right">Listened: {calculated !== 'stopped' && listenedDuration !== null ? `${listenedDuration.toFixed(0)}s` : '-'}{durPer}</p> 101 101 </div> 102 102 </section> 103 103 <PlayerInfo data={data} isVisible={viewMode === 'playlist'} />