use a "CacheCover" folder for scaled covers
This commit is contained in:
@@ -25,8 +25,9 @@ const (
|
||||
|
||||
type Controller struct {
|
||||
*ctrlbase.Controller
|
||||
CachePath string
|
||||
Jukebox *jukebox.Jukebox
|
||||
CachePath string
|
||||
CoverCachePath string
|
||||
Jukebox *jukebox.Jukebox
|
||||
}
|
||||
|
||||
type metaResponse struct {
|
||||
|
||||
@@ -106,7 +106,7 @@ func (c *Controller) ServeGetCoverArt(w http.ResponseWriter, r *http.Request) *s
|
||||
}
|
||||
size := params.GetOrInt("size", coverDefaultSize)
|
||||
cachePath := path.Join(
|
||||
c.CachePath,
|
||||
c.CoverCachePath,
|
||||
fmt.Sprintf("%s-%d.%s", id.String(), size, coverCacheFormat),
|
||||
)
|
||||
_, err = os.Stat(cachePath)
|
||||
|
||||
@@ -21,10 +21,11 @@ import (
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
DB *db.DB
|
||||
MusicPath string
|
||||
CachePath string
|
||||
ProxyPrefix string
|
||||
DB *db.DB
|
||||
MusicPath string
|
||||
CachePath string
|
||||
CoverCachePath string
|
||||
ProxyPrefix string
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
@@ -61,9 +62,10 @@ func New(opts Options) *Server {
|
||||
//
|
||||
ctrlAdmin := ctrladmin.New(base, sessDB)
|
||||
ctrlSubsonic := &ctrlsubsonic.Controller{
|
||||
Controller: base,
|
||||
CachePath: opts.CachePath,
|
||||
Jukebox: jukebox,
|
||||
Controller: base,
|
||||
CachePath: opts.CachePath,
|
||||
CoverCachePath: opts.CoverCachePath,
|
||||
Jukebox: jukebox,
|
||||
}
|
||||
setupMisc(r, base)
|
||||
setupAdmin(r.PathPrefix("/admin").Subrouter(), ctrlAdmin)
|
||||
|
||||
Reference in New Issue
Block a user