Compare commits
3 Commits
1eb81d2da5
...
1888592d07
Author | SHA1 | Date |
---|---|---|
Stein Ivar Berghei | 1888592d07 | |
Stein Ivar Berghei | 1d2374a398 | |
Stein Ivar Berghei | bec3683b44 |
|
@ -0,0 +1,16 @@
|
||||||
|
ambiance
|
||||||
|
bin
|
||||||
|
cache
|
||||||
|
config
|
||||||
|
cookies.txt
|
||||||
|
dndmusicbot
|
||||||
|
Dockerfile
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.dockerignore
|
||||||
|
.jsimage
|
||||||
|
k8s
|
||||||
|
MPD
|
||||||
|
oauth.cfg
|
||||||
|
test
|
||||||
|
src
|
|
@ -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
|
||||||
|
|
12
events.go
12
events.go
|
@ -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()
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue