Rename env vars prefix to ND_
This commit is contained in:
@@ -28,7 +28,7 @@ type artistRepository struct {
|
||||
func NewArtistRepository(o orm.Ormer) model.ArtistRepository {
|
||||
r := &artistRepository{}
|
||||
r.ormer = o
|
||||
r.indexGroups = utils.ParseIndexGroups(conf.Sonic.IndexGroups)
|
||||
r.indexGroups = utils.ParseIndexGroups(conf.Server.IndexGroups)
|
||||
r.tableName = "artist"
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func NewMediaFolderRepository(o orm.Ormer) model.MediaFolderRepository {
|
||||
}
|
||||
|
||||
func (*mediaFolderRepository) GetAll() (model.MediaFolders, error) {
|
||||
mediaFolder := model.MediaFolder{ID: "0", Path: conf.Sonic.MusicFolder}
|
||||
mediaFolder := model.MediaFolder{ID: "0", Path: conf.Server.MusicFolder}
|
||||
mediaFolder.Name = "Music Library"
|
||||
result := make(model.MediaFolders, 1)
|
||||
result[0] = mediaFolder
|
||||
|
||||
@@ -27,7 +27,7 @@ type SQLStore struct {
|
||||
|
||||
func New() model.DataStore {
|
||||
once.Do(func() {
|
||||
dbPath := conf.Sonic.DbPath
|
||||
dbPath := conf.Server.DbPath
|
||||
if dbPath == ":memory:" {
|
||||
dbPath = "file::memory:?cache=shared"
|
||||
}
|
||||
@@ -114,7 +114,7 @@ func (db *SQLStore) getOrmer() orm.Ormer {
|
||||
}
|
||||
|
||||
func initORM(dbPath string) error {
|
||||
verbose := conf.Sonic.LogLevel == "trace"
|
||||
verbose := conf.Server.LogLevel == "trace"
|
||||
orm.Debug = verbose
|
||||
if strings.Contains(dbPath, "postgres") {
|
||||
driver = "postgres"
|
||||
|
||||
@@ -60,9 +60,9 @@ func P(path string) string {
|
||||
var _ = Describe("Initialize test DB", func() {
|
||||
BeforeSuite(func() {
|
||||
//log.SetLevel(log.LevelTrace)
|
||||
//conf.Sonic.DbPath, _ = ioutil.TempDir("", "navidrome_tests")
|
||||
//os.MkdirAll(conf.Sonic.DbPath, 0700)
|
||||
conf.Sonic.DbPath = ":memory:"
|
||||
//conf.Server.DbPath, _ = ioutil.TempDir("", "navidrome_tests")
|
||||
//os.MkdirAll(conf.Server.DbPath, 0700)
|
||||
conf.Server.DbPath = ":memory:"
|
||||
ds := New()
|
||||
artistRepo := ds.Artist()
|
||||
for _, a := range testArtists {
|
||||
|
||||
Reference in New Issue
Block a user