navidrome/assets/external.go

21 lines
331 B
Go
Raw Normal View History

2020-01-23 00:35:44 +01:00
// +build !embed
package assets
import (
"net/http"
2020-01-25 02:35:20 +01:00
"sync"
2020-01-23 00:35:44 +01:00
2020-01-24 01:44:08 +01:00
"github.com/deluan/navidrome/consts"
2020-01-25 02:35:20 +01:00
"github.com/deluan/navidrome/log"
2020-01-23 00:35:44 +01:00
)
2020-01-25 02:35:20 +01:00
var once sync.Once
2020-01-23 00:35:44 +01:00
func AssetFile() http.FileSystem {
2020-01-25 02:35:20 +01:00
once.Do(func() {
log.Warn("Using external assets from " + consts.UIAssetsLocalPath)
})
2020-01-23 00:35:44 +01:00
return http.Dir(consts.UIAssetsLocalPath)
}