From 932f5760dfe41638205ea3a26cd68a34d4236140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= Date: Wed, 27 Dec 2023 18:23:51 +0000 Subject: [PATCH] Store list of added songs to Redis --- src/app/actions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/actions.ts b/src/app/actions.ts index 6628ab6..59802fb 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -2,6 +2,7 @@ import { getSpotify } from "@/utils/auth"; import { SPOTIFY_MARKET } from "@/utils/constants"; +import redis from "@/utils/redis"; export async function searchTracks(query: string) { const spotify = await getSpotify(); @@ -20,4 +21,6 @@ export async function pushTrack(uri: string) { const success = await spotify.user.player.addItem(uri); if (!success) throw new Error("Failed to push track"); + + await redis.rPush("playlist", uri); }