revert: separation of write and read DBs

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2024-11-18 15:52:13 +02:00
parent 1bf94531fd
commit 3982ba7258
22 changed files with 78 additions and 161 deletions

View file

@ -6,7 +6,6 @@ import (
"github.com/Masterminds/squirrel"
"github.com/google/uuid"
"github.com/navidrome/navidrome/db"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/model/request"
@ -21,7 +20,7 @@ var _ = Describe("PlayQueueRepository", func() {
BeforeEach(func() {
ctx = log.NewContext(context.TODO())
ctx = request.WithUser(ctx, model.User{ID: "userid", UserName: "userid", IsAdmin: true})
repo = NewPlayQueueRepository(ctx, NewDBXBuilder(db.Db()))
repo = NewPlayQueueRepository(ctx, GetDBXBuilder())
})
Describe("PlayQueues", func() {
@ -57,7 +56,7 @@ var _ = Describe("PlayQueueRepository", func() {
// Add a new song to the DB
newSong := songRadioactivity
newSong.ID = "temp-track"
mfRepo := NewMediaFileRepository(ctx, NewDBXBuilder(db.Db()))
mfRepo := NewMediaFileRepository(ctx, GetDBXBuilder())
Expect(mfRepo.Put(&newSong)).To(Succeed())