added timeout to reload when going to next song

This commit is contained in:
DeaDvey 2024-11-04 22:24:21 +00:00
parent 2d6c7bd5e4
commit 731f285071

View File

@ -34,12 +34,16 @@ app.post("/music/playpause",(req,res) => {
app.post("/music/next",(req,res) => {
console.log("skipping to next song")
exec('echo playlist-next | socat - "/tmp/mpvsocket"')
res.redirect(302, req.get("referer"));
setTimeout(function() {
res.redirect(302, req.get("referer"));
}, 750);
});
app.post("/music/prev",(req,res) => {
console.log("going back to previous song")
exec('echo playlist-prev | socat - "/tmp/mpvsocket"')
res.redirect(302, req.get("referer"));
setTimeout(function() {
res.redirect(302, req.get("referer"));
}, 750);
});
```