mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57: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"
|
||||
)
|
||||
|
||||
var (
|
||||
//go:embed *
|
||||
embedFS embed.FS
|
||||
fsOnce sync.Once
|
||||
fsys fs.FS
|
||||
)
|
||||
//go:embed *
|
||||
var embedFS embed.FS
|
||||
|
||||
func FS() fs.FS {
|
||||
fsOnce.Do(func() {
|
||||
fsys = merge.FS{
|
||||
Base: embedFS,
|
||||
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
||||
}
|
||||
})
|
||||
return fsys
|
||||
}
|
||||
var FS = sync.OnceValue(func() fs.FS {
|
||||
return merge.FS{
|
||||
Base: embedFS,
|
||||
Overlay: os.DirFS(path.Join(conf.Server.DataFolder, "resources")),
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue