From 0dbf59c2958d2fe7d8d6757cdc5619e0d38b42de Mon Sep 17 00:00:00 2001 From: OfficialDakari Date: Fri, 18 Oct 2024 21:57:26 +0500 Subject: [PATCH] fix --- routes/ytm.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/ytm.ts b/routes/ytm.ts index 142408b..fc5e457 100644 --- a/routes/ytm.ts +++ b/routes/ytm.ts @@ -18,6 +18,9 @@ export default function routeYTM(app: Application) { songs = await ytmApi.searchSongs(req.query.q); dbStore('cache', md5(req.query.q), songs); } + for (const song of songs) { + dbStore('cache', song.videoId, song); + } res.send(songs); } )); @@ -55,7 +58,7 @@ export default function routeYTM(app: Application) { if (existsSync(filePath)) { res.sendFile(realpathSync(filePath)); } else { - throw createHttpError[404](); + throw createHttpError[404](); } } ));