Compare commits

..

3 Commits

Author SHA1 Message Date
Stein Ivar Berghei 1888592d07 Increase volume ranges 2023-08-20 11:45:10 +02:00
Stein Ivar Berghei 1d2374a398 Ignore parsefloat errors 2023-08-20 11:44:23 +02:00
Stein Ivar Berghei bec3683b44 Update image to bookworm 2023-08-20 11:43:47 +02:00
4 changed files with 25 additions and 17 deletions

16
.dockerignore Normal file
View File

@ -0,0 +1,16 @@
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.20 as builder FROM golang:1.21-bookworm 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:bullseye-slim FROM debian:bookworm-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 mpd ffmpeg
COPY --from=builder /src/dndmusicbot /app/ COPY --from=builder /src/dndmusicbot /app/
ADD tmpl /app/tmpl ADD tmpl /app/tmpl

View File

@ -374,16 +374,8 @@ 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, err := strconv.ParseFloat(status["duration"], 64) slen, _ := strconv.ParseFloat(status["duration"], 64)
if err != nil { spos, _ := strconv.ParseFloat(status["elapsed"], 64)
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="-6" max="1" step="0.1"> <input type="range" id="playlist-volume" min="-10" max="4" step="0.1">
<input id="playlist-volume-number" type="number" min="-6" max="1" step="0.1" style="width:50px" /> <input id="playlist-volume-number" type="number" min="-10" max="4" 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="-4" max="4" step="0.1"> <input type="range" id="ambiance-volume" min="-10" max="4" step="0.1">
<input id="ambiance-volume-number" type="number" min="-4" max="4" step="0.1" style="width:50px" /> <input id="ambiance-volume-number" type="number" min="-10" max="4" step="0.1" style="width:50px" />
</div> </div>
</section> </section>