stream: add a skip-to-next button and /skip route

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-07-02 23:55:17 +08:00
commit a468d78153
2 changed files with 33 additions and 0 deletions

View file

@ -111,3 +111,14 @@ harbor.http.register(
resp.json({title=m["title"], artist=m["artist"]})
end
)
# Passer au morceau suivant : on saute le morceau en cours sur la source
# diffusée. request.dynamic a déjà préchargé le suivant, donc l'enchaînement
# est immédiat (le prochain /next est demandé au daemon dans la foulée).
harbor.http.register(
port=8000, method="POST", "/skip",
fun(_, resp) -> begin
source.skip(radio)
resp.json({skipped=true})
end
)