mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Add scrobble functionality (#19)
* Fix slider bar background to use theme * Add "scrobbleAtDuration" to settings store * Add subscribeWithSelector and playCount incrementor * Add scrobbling API and mutation * Add scrobble settings * Begin support for multi-server queue handling * Dynamically set version on auth header * Add scrobbling functionality for navidrome/jellyfin
This commit is contained in:
parent
85bf910d65
commit
484c96187c
14 changed files with 1253 additions and 653 deletions
|
|
@ -20,6 +20,7 @@ export interface AuthSlice extends AuthState {
|
|||
actions: {
|
||||
addServer: (args: ServerListItem) => void;
|
||||
deleteServer: (id: string) => void;
|
||||
getServer: (id?: string) => ServerListItem | undefined;
|
||||
setCurrentServer: (server: ServerListItem | null) => void;
|
||||
updateServer: (id: string, args: Partial<ServerListItem>) => void;
|
||||
};
|
||||
|
|
@ -28,7 +29,7 @@ export interface AuthSlice extends AuthState {
|
|||
export const useAuthStore = create<AuthSlice>()(
|
||||
persist(
|
||||
devtools(
|
||||
immer((set) => ({
|
||||
immer((set, get) => ({
|
||||
actions: {
|
||||
addServer: (args) => {
|
||||
set((state) => {
|
||||
|
|
@ -43,6 +44,9 @@ export const useAuthStore = create<AuthSlice>()(
|
|||
}
|
||||
});
|
||||
},
|
||||
getServer: (id) => {
|
||||
return get().serverList.find((server) => server.id === id);
|
||||
},
|
||||
setCurrentServer: (server) => {
|
||||
set((state) => {
|
||||
state.currentServer = server;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue