Fine tuning skip range

This commit is contained in:
Deluan 2016-03-29 09:02:53 -04:00
parent 768764bea7
commit edcfd9dd61
2 changed files with 7 additions and 7 deletions

View File

@ -11,8 +11,8 @@ import (
)
const (
minSkipped = time.Duration(5) * time.Second
maxSkipped = time.Duration(20) * time.Second
minSkipped = time.Duration(3) * time.Second
maxSkipped = time.Duration(10) * time.Second
)
type Scrobbler interface {

View File

@ -114,8 +114,8 @@ func TestSkipping(t *testing.T) {
Convey("When I play one song", func() {
npRepo.OverrideNow(aPointInTime)
scrobbler.NowPlaying(1, "DSub", "1", "deluan")
Convey("And I skip it before 20 seconds", func() {
npRepo.OverrideNow(aPointInTime.Add(time.Duration(5) * time.Second))
Convey("And I skip it before 10 seconds", func() {
npRepo.OverrideNow(aPointInTime.Add(time.Duration(7) * time.Second))
scrobbler.NowPlaying(1, "DSub", "2", "deluan")
Convey("Then the first song should be marked as skipped", func() {
mf, err := scrobbler.Register(1, "2", aPointInTime.Add(time.Duration(3)*time.Minute))
@ -124,8 +124,8 @@ func TestSkipping(t *testing.T) {
So(err, ShouldBeNil)
})
})
Convey("And I skip it after 5 seconds", func() {
npRepo.OverrideNow(aPointInTime.Add(time.Duration(3) * time.Second))
Convey("And I skip it before 3 seconds", func() {
npRepo.OverrideNow(aPointInTime.Add(time.Duration(2) * time.Second))
scrobbler.NowPlaying(1, "DSub", "2", "deluan")
Convey("Then the first song should be marked as skipped", func() {
mf, err := scrobbler.Register(1, "2", aPointInTime.Add(time.Duration(3)*time.Minute))
@ -134,7 +134,7 @@ func TestSkipping(t *testing.T) {
So(err, ShouldBeNil)
})
})
Convey("And I skip it after 20 seconds", func() {
Convey("And I skip it after 10 seconds", func() {
npRepo.OverrideNow(aPointInTime.Add(time.Duration(30) * time.Second))
scrobbler.NowPlaying(1, "DSub", "2", "deluan")
Convey("Then the first song should be marked as skipped", func() {