fix
This commit is contained in:
parent
8de536efc9
commit
0dbf59c295
|
|
@ -18,6 +18,9 @@ export default function routeYTM(app: Application) {
|
||||||
songs = await ytmApi.searchSongs(req.query.q);
|
songs = await ytmApi.searchSongs(req.query.q);
|
||||||
dbStore('cache', md5(req.query.q), songs);
|
dbStore('cache', md5(req.query.q), songs);
|
||||||
}
|
}
|
||||||
|
for (const song of songs) {
|
||||||
|
dbStore('cache', song.videoId, song);
|
||||||
|
}
|
||||||
res.send(songs);
|
res.send(songs);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
@ -55,7 +58,7 @@ export default function routeYTM(app: Application) {
|
||||||
if (existsSync(filePath)) {
|
if (existsSync(filePath)) {
|
||||||
res.sendFile(realpathSync(filePath));
|
res.sendFile(realpathSync(filePath));
|
||||||
} else {
|
} else {
|
||||||
throw createHttpError[404]();
|
throw createHttpError[404]();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue