Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from DisgoOrg/disgolink-update
Browse files Browse the repository at this point in the history
Disgolink update
  • Loading branch information
topi314 authored Feb 27, 2022
2 parents 8befdad + 762a34f commit 795204e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module github.com/DisgoOrg/source-extensions-plugin
go 1.17

require (
github.com/DisgoOrg/disgolink/lavalink v1.3.0
github.com/DisgoOrg/disgolink/lavalink v1.4.0
github.com/pkg/errors v0.9.1
)

require (
github.com/DisgoOrg/log v1.1.3 // indirect
github.com/DisgoOrg/snowflake v1.0.4 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
github.com/DisgoOrg/disgolink/lavalink v1.3.0 h1:8mRfKftEhrNx4MgegdXBj23eTWpgRUn2GkFp/VOmst8=
github.com/DisgoOrg/disgolink/lavalink v1.3.0/go.mod h1:u14urQSHp9DA41yYi3RnhGLeSw2J0WeN1za2Rr4Kekg=
github.com/DisgoOrg/disgolink/lavalink v1.4.0 h1:9J6ZHxjYOt3OjJQgKqU4vxlZ9yHlHa/RuATAkbvwXPA=
github.com/DisgoOrg/disgolink/lavalink v1.4.0/go.mod h1:xnCkE/9HqWAX0+pTCnb6y8zCsiZSNYDTABzp5uZ7h+w=
github.com/DisgoOrg/log v1.1.3 h1:UN0ZfmPZ7yhCCDQ7iVvIedvZ2zEexNS5Ek76GBuffOE=
github.com/DisgoOrg/log v1.1.3/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.4 h1:hgeXSaXRDVdoNJ0rfHXyVsgxQMzctP346S5WXlBmoOU=
github.com/DisgoOrg/snowflake v1.0.4/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
30 changes: 12 additions & 18 deletions isrc_source_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ func (p ISRCSourceExtension) Decode(info lavalink.AudioTrackInfo, r io.Reader) (
}

return &ISRCAudioTrack{
AudioTrackInfo: info,
ISRC: isrc,
ArtworkURL: artworkURL,
AudioTrack: &lavalink.BasicAudioTrack{
AudioTrackInfo: info,
},
ISRC: isrc,
ArtworkURL: artworkURL,
}, nil
}

Expand All @@ -43,21 +45,13 @@ var (
)

type ISRCAudioTrack struct {
AudioTrackInfo lavalink.AudioTrackInfo `json:"info"`
ISRC *string `json:"isrc"`
ArtworkURL *string `json:"artwork_url"`
}

func (t *ISRCAudioTrack) Info() lavalink.AudioTrackInfo {
return t.AudioTrackInfo
}

func (t *ISRCAudioTrack) SetPosition(position lavalink.Duration) {
t.AudioTrackInfo.Position = position
lavalink.AudioTrack
ISRC *string `json:"isrc"`
ArtworkURL *string `json:"artwork_url"`
}

func (t *ISRCAudioTrack) Clone() lavalink.AudioTrack {
info := t.AudioTrackInfo
info := t.Info()
info.Position = 0
var (
isrc, artworkURL *string
Expand All @@ -71,8 +65,8 @@ func (t *ISRCAudioTrack) Clone() lavalink.AudioTrack {
*artworkURL = *t.ArtworkURL
}
return &ISRCAudioTrack{
AudioTrackInfo: info,
ISRC: isrc,
ArtworkURL: artworkURL,
AudioTrack: t.AudioTrack.Clone(),
ISRC: isrc,
ArtworkURL: artworkURL,
}
}

0 comments on commit 795204e

Please sign in to comment.