move cache path from base controller to subsonic controller
This commit is contained in:
@@ -24,11 +24,13 @@ const (
|
||||
|
||||
type Controller struct {
|
||||
*ctrlbase.Controller
|
||||
cachePath string
|
||||
}
|
||||
|
||||
func New(base *ctrlbase.Controller) *Controller {
|
||||
func New(base *ctrlbase.Controller, cachePath string) *Controller {
|
||||
return &Controller{
|
||||
Controller: base,
|
||||
cachePath: cachePath,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,10 @@ func init() {
|
||||
if err != nil {
|
||||
log.Fatalf("error opening database: %v\n", err)
|
||||
}
|
||||
testController = New(&ctrlbase.Controller{DB: db})
|
||||
testController = New(
|
||||
&ctrlbase.Controller{DB: db},
|
||||
"",
|
||||
)
|
||||
}
|
||||
|
||||
type queryCase struct {
|
||||
|
||||
@@ -136,7 +136,7 @@ func (c *Controller) ServeStream(w http.ResponseWriter, r *http.Request) *spec.R
|
||||
}
|
||||
servOpts.pref = pref
|
||||
servOpts.maxBitrate = params.GetIntOr("maxBitRate", 0)
|
||||
servOpts.cachePath = c.CachePath
|
||||
servOpts.cachePath = c.cachePath
|
||||
serveTrackEncode(w, r, servOpts)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user