Register PlayCount/Date in the DB, if DevUseFolderScanner is true

This commit is contained in:
Deluan
2020-01-18 20:59:20 -05:00
parent 3c66da0b17
commit 938a92eded
8 changed files with 39 additions and 6 deletions
+4 -2
View File
@@ -17,10 +17,11 @@ func TestScrobbler(t *testing.T) {
Init(t, false)
mfRepo := persistence.CreateMockMediaFileRepo()
alRepo := persistence.CreateMockAlbumRepo()
npRepo := engine.CreateMockNowPlayingRepo()
itCtrl := &mockItunesControl{}
scrobbler := engine.NewScrobbler(itCtrl, mfRepo, npRepo)
scrobbler := engine.NewScrobbler(itCtrl, mfRepo, alRepo, npRepo)
Convey("Given a DB with one song", t, func() {
mfRepo.SetData(`[{"ID":"2","Title":"Hands Of Time"}]`, 1)
@@ -89,10 +90,11 @@ func TestSkipping(t *testing.T) {
Init(t, false)
mfRepo := persistence.CreateMockMediaFileRepo()
alRepo := persistence.CreateMockAlbumRepo()
npRepo := engine.CreateMockNowPlayingRepo()
itCtrl := &mockItunesControl{}
scrobbler := engine.NewScrobbler(itCtrl, mfRepo, npRepo)
scrobbler := engine.NewScrobbler(itCtrl, mfRepo, alRepo, npRepo)
Convey("Given a DB with three songs", t, func() {
mfRepo.SetData(`[{"ID":"1","Title":"Femme Fatale"},{"ID":"2","Title":"Here She Comes Now"},{"ID":"3","Title":"Lady Godiva's Operation"}]`, 3)