update album play count

This commit is contained in:
Kendall Garner 2024-09-15 21:48:32 -07:00
parent f82889e5ec
commit 96b4f8dd89
No known key found for this signature in database
GPG key ID: 18D2767419676C87
3 changed files with 39 additions and 6 deletions

View file

@ -27,7 +27,7 @@ export interface EventState {
export interface EventSlice extends EventState {
actions: {
favorite: (ids: string[], favorite: boolean) => void;
play: (ids: string[]) => void;
play: (id: string) => void;
rate: (ids: string[], rating: number | null) => void;
};
}
@ -43,10 +43,10 @@ export const useEventStore = create<EventSlice>()(
state.ids = ids;
});
},
play(ids) {
play(id) {
set((state) => {
state.event = { event: 'play', timestamp: new Date().toISOString() };
state.ids = ids;
state.ids = [id];
});
},
rate(ids, rating) {