Add cachePath variable and CLI option
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
type Options struct {
|
||||
DB *db.DB
|
||||
MusicPath string
|
||||
CachePath string
|
||||
ListenAddr string
|
||||
ScanInterval time.Duration
|
||||
ProxyPrefix string
|
||||
@@ -35,11 +36,13 @@ type Server struct {
|
||||
func New(opts Options) *Server {
|
||||
// ** begin sanitation
|
||||
opts.MusicPath = filepath.Clean(opts.MusicPath)
|
||||
opts.CachePath = filepath.Clean(opts.CachePath)
|
||||
// ** begin controllers
|
||||
scanner := scanner.New(opts.DB, opts.MusicPath)
|
||||
base := &ctrlbase.Controller{
|
||||
DB: opts.DB,
|
||||
MusicPath: opts.MusicPath,
|
||||
CachePath: opts.CachePath,
|
||||
ProxyPrefix: opts.ProxyPrefix,
|
||||
Scanner: scanner,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user