Compare commits

..

No commits in common. "1888592d07e7b114f5a0db09cef32b665510e391" and "1eb81d2da53725c9c1877e3d7806bc2eb0bb626f" have entirely different histories.

4 changed files with 17 additions and 25 deletions

View File

@ -1,16 +0,0 @@
ambiance
bin
cache
config
cookies.txt
dndmusicbot
Dockerfile
.git
.gitignore
.dockerignore
.jsimage
k8s
MPD
oauth.cfg
test
src

View File

@ -1,14 +1,14 @@
FROM golang:1.21-bookworm as builder FROM golang:1.20 as builder
WORKDIR /src WORKDIR /src
COPY . . COPY . .
RUN apt-get update && apt-get -y install libopus-dev libopusfile-dev && \ RUN apt-get update && apt-get -y install libopus-dev libopusfile-dev && \
go build go build
FROM debian:bookworm-slim FROM debian:bullseye-slim
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ca-certificates \ ca-certificates \
libopus-dev libopusfile-dev \ libopus-dev libopusfile-dev \
mpd ffmpeg mpd
COPY --from=builder /src/dndmusicbot /app/ COPY --from=builder /src/dndmusicbot /app/
ADD tmpl /app/tmpl ADD tmpl /app/tmpl

View File

@ -374,8 +374,16 @@ func (app *App) songPosition(payload ...interface{}) {
msg := make(map[string]interface{}) msg := make(map[string]interface{})
out := make(map[string]interface{}) out := make(map[string]interface{})
slen, _ := strconv.ParseFloat(status["duration"], 64) slen, err := strconv.ParseFloat(status["duration"], 64)
spos, _ := strconv.ParseFloat(status["elapsed"], 64) if err != nil {
log.Println(err)
return
}
spos, err := strconv.ParseFloat(status["elapsed"], 64)
if err != nil {
return
}
msg["event"] = "song_position" msg["event"] = "song_position"
out["len"] = time.Duration(slen * float64(time.Second)).Milliseconds() out["len"] = time.Duration(slen * float64(time.Second)).Milliseconds()

View File

@ -70,13 +70,13 @@
<section> <section>
<div id="volume_playlist" class="input-container"> <div id="volume_playlist" class="input-container">
<label for="playlist-volume">Playlist</label> <label for="playlist-volume">Playlist</label>
<input type="range" id="playlist-volume" min="-10" max="4" step="0.1"> <input type="range" id="playlist-volume" min="-6" max="1" step="0.1">
<input id="playlist-volume-number" type="number" min="-10" max="4" step="0.1" style="width:50px" /> <input id="playlist-volume-number" type="number" min="-6" max="1" step="0.1" style="width:50px" />
</div> </div>
<div id="volume_ambiance" class="input-container"> <div id="volume_ambiance" class="input-container">
<label for="ambiance-volume">Ambiance</label> <label for="ambiance-volume">Ambiance</label>
<input type="range" id="ambiance-volume" min="-10" max="4" step="0.1"> <input type="range" id="ambiance-volume" min="-4" max="4" step="0.1">
<input id="ambiance-volume-number" type="number" min="-10" max="4" step="0.1" style="width:50px" /> <input id="ambiance-volume-number" type="number" min="-4" max="4" step="0.1" style="width:50px" />
</div> </div>
</section> </section>