From b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 23 Dec 2022 08:51:37 +0100 Subject: implement local storage backend The 'local' backend is able to serve the music from a path specified by '-server-music-dir'. Add command line options to select the server port as well as a list of backends. --- wrms.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'wrms.go') diff --git a/wrms.go b/wrms.go index 252c14e..ee3274c 100644 --- a/wrms.go +++ b/wrms.go @@ -3,8 +3,9 @@ package main import ( "encoding/json" "fmt" + "strings" - "muhq.space/wrms/llog" + "muhq.space/go/wrms/llog" "github.com/google/uuid" @@ -63,11 +64,13 @@ type Wrms struct { CurrentSong Song Player Player Playing bool + Config Config } -func NewWrms() *Wrms { +func NewWrms(config Config) *Wrms { wrms := Wrms{} - wrms.Player = NewPlayer(&wrms) + wrms.Config = config + wrms.Player = NewPlayer(&wrms, strings.Split(config.backends, " ")) return &wrms } -- cgit v1.2.3