mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
Simplify resources.FS
This commit is contained in:
parent
7f52ff72dc
commit
a7a4fb522c
1 changed files with 8 additions and 15 deletions
|
@ -11,19 +11,12 @@ import (
|
||||||
"github.com/navidrome/navidrome/utils/merge"
|
"github.com/navidrome/navidrome/utils/merge"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
//go:embed *
|
||||||
//go:embed *
|
var embedFS embed.FS
|
||||||
embedFS embed.FS
|
|
||||||
fsOnce sync.Once
|
|
||||||
fsys fs.FS
|
|
||||||
)
|
|
||||||
|
|
||||||
func FS() fs.FS {
|
var FS = sync.OnceValue(func() fs.FS {
|
||||||
fsOnce.Do(func() {
|
return merge.FS{
|
||||||
fsys = merge.FS{
|
Base: embedFS,
|
||||||
Base: embedFS,
|
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
||||||
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
return fsys
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue