Skip to content

Commit

Permalink
refactor(seek): change guildID parameter's type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasl-dev committed Aug 1, 2021
1 parent 74e0259 commit 1f23fad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion connection_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (conn *MockedConnection) Play(guildID string, trackID string, opts ...*play

// Seek skips the current track of a guild's audio
// player to the passed position.
func (conn *MockedConnection) Seek(guildID, position uint) error {
func (conn *MockedConnection) Seek(guildID string, position uint) error {
return conn.Called(guildID, position).Error(0)
}

Expand Down
6 changes: 2 additions & 4 deletions driver/websocketdriver/seeker.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
package websocketdriver

import (
"strconv"

"github.com/gorilla/websocket"
"github.com/lukasl-dev/waterlink/usecase/seek"
)
Expand All @@ -49,10 +47,10 @@ type seekPayload struct {
Position uint `json:"position,omitempty"`
}

func (s *seeker) Seek(guildID, position uint) error {
func (s *seeker) Seek(guildID string, position uint) error {
return s.conn.WriteJSON(seekPayload{
OP: opSeek,
GuildID: strconv.Itoa(int(guildID)),
GuildID: guildID,
Position: position,
})
}
2 changes: 1 addition & 1 deletion usecase/seek/seek.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ package seek
type Seeker interface {
// Seek skips the current track of a guild's audio
// player to the passed position.
Seek(guildID, position uint) error
Seek(guildID string, position uint) error
}
2 changes: 1 addition & 1 deletion usecase/seek/seek_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ func NewMockedSeeker() *MockedSeeker {

// Seek skips the current track of a guild's audio
// player to the passed position.
func (s *MockedSeeker) Seek(guildID, position uint) error {
func (s *MockedSeeker) Seek(guildID string, position uint) error {
return s.Called(guildID, position).Error(0)
}

0 comments on commit 1f23fad

Please sign in to comment.