feat(ui): add Now Playing panel for admins (#4209)
* feat(ui): add Now Playing panel and integrate now playing count updates Signed-off-by: Deluan <deluan@navidrome.org> * fix: check return value in test to satisfy linter * fix: format React code with prettier * fix: resolve race condition in play tracker test * fix: log error when fetching now playing data fails Signed-off-by: Deluan <deluan@navidrome.org> * feat(ui): refactor Now Playing panel with new components and error handling Signed-off-by: Deluan <deluan@navidrome.org> * fix(ui): adjust padding and height in Now Playing panel for improved layout Signed-off-by: Deluan <deluan@navidrome.org> * fix(cache): add automatic cleanup to prevent goroutine leak on cache garbage collection Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
EVENT_REFRESH_RESOURCE,
|
||||
EVENT_SCAN_STATUS,
|
||||
EVENT_SERVER_START,
|
||||
EVENT_NOW_PLAYING_COUNT,
|
||||
} from '../actions'
|
||||
import config from '../config'
|
||||
|
||||
@@ -14,6 +15,7 @@ const initialState = {
|
||||
elapsedTime: 0,
|
||||
},
|
||||
serverStart: { version: config.version },
|
||||
nowPlayingCount: 0,
|
||||
}
|
||||
|
||||
export const activityReducer = (previousState = initialState, payload) => {
|
||||
@@ -40,6 +42,8 @@ export const activityReducer = (previousState = initialState, payload) => {
|
||||
resources: data,
|
||||
},
|
||||
}
|
||||
case EVENT_NOW_PLAYING_COUNT:
|
||||
return { ...previousState, nowPlayingCount: data.count }
|
||||
default:
|
||||
return previousState
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user