mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-15 14:48:41 +01:00
test(scanner): add tests for multi-library scanning and validation
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
daa3648b06
commit
4c06cd2ac8
2 changed files with 512 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ type MockDataStore struct {
|
|||
MockedScrobbleBuffer model.ScrobbleBufferRepository
|
||||
MockedRadio model.RadioRepository
|
||||
scrobbleBufferMu sync.Mutex
|
||||
repoMu sync.Mutex
|
||||
}
|
||||
|
||||
func (db *MockDataStore) Library(ctx context.Context) model.LibraryRepository {
|
||||
|
|
@ -85,6 +86,8 @@ func (db *MockDataStore) Artist(ctx context.Context) model.ArtistRepository {
|
|||
}
|
||||
|
||||
func (db *MockDataStore) MediaFile(ctx context.Context) model.MediaFileRepository {
|
||||
db.repoMu.Lock()
|
||||
defer db.repoMu.Unlock()
|
||||
if db.MockedMediaFile == nil {
|
||||
if db.RealDS != nil {
|
||||
db.MockedMediaFile = db.RealDS.MediaFile(ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue