Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 0 additions & 83 deletions Gopkg.lock

This file was deleted.

50 changes: 0 additions & 50 deletions Gopkg.toml

This file was deleted.

22 changes: 11 additions & 11 deletions cmd/playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ func displayTrackById(cmd *cobra.Command, args []string) error {
return err
}

displayTrack(track)
return nil
displayTrack(track)
return nil
}

func displayCurrentTrack(cmd *cobra.Command, args []string) error {
Expand All @@ -221,7 +221,7 @@ func displayCurrentTrack(cmd *cobra.Command, args []string) error {
return err
}

displayTrack(playing.Item)
displayTrack(playing.Item)
return nil
}

Expand All @@ -248,7 +248,7 @@ func addto(cmd *cobra.Command, args []string) error {
fmt.Println("Track: ", playing.Item.Name)

// add track to playlist
_, err = client.AddTracksToPlaylist(user.ID, pl.ID, playing.Item.ID)
_, err = client.AddTracksToPlaylist(pl.ID, playing.Item.ID)
if err != nil {
Comment on lines +251 to 252
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_, err = client.AddTracksToPlaylist(pl.ID, playing.Item.ID)
if err != nil {
if _, err = client.AddTracksToPlaylist(pl.ID, playing.Item.ID); err != nil {

return err
}
Expand Down Expand Up @@ -303,7 +303,7 @@ func newPlaylist(cmd *cobra.Command, args []string) error {
fmt.Println("User: ", user.DisplayName)

// create new playlist
playlist, err := client.CreatePlaylistForUser(user.ID, newPlaylistName, true)
playlist, err := client.CreatePlaylistForUser(user.ID, newPlaylistName, newPlaylistName, true)
if err != nil {
return err
}
Expand Down Expand Up @@ -353,7 +353,7 @@ func addTrackByIDToPlaylist(cmd *cobra.Command, args []string) error {
fmt.Println("Track: ", tr.Name)

// add track to playlist
_, err = client.AddTracksToPlaylist(user.ID, pl.ID, tr.ID)
_, err = client.AddTracksToPlaylist(pl.ID, tr.ID)
if err != nil {
Comment on lines +356 to 357
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_, err = client.AddTracksToPlaylist(pl.ID, tr.ID)
if err != nil {
if _, err = client.AddTracksToPlaylist(pl.ID, tr.ID); err != nil {

return err
}
Expand Down Expand Up @@ -389,7 +389,7 @@ func addTrackByNameToPlaylist(cmd *cobra.Command, args []string) error {
fmt.Println("Track: ", tracks[0].Name)

// add track to playlist
_, err = client.AddTracksToPlaylist(user.ID, pl.ID, tracks[0].ID)
_, err = client.AddTracksToPlaylist(pl.ID, tracks[0].ID)
if err != nil {
Comment on lines +392 to 393
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_, err = client.AddTracksToPlaylist(pl.ID, tracks[0].ID)
if err != nil {
if _, err = client.AddTracksToPlaylist(pl.ID, tracks[0].ID); err != nil {

return err
}
Expand All @@ -416,7 +416,7 @@ func rmTrackByNameFromPlaylist(cmd *cobra.Command, args []string) error {

// get track in playlist and validate existence
var matchedTrack spotify.SimpleTrack
ptracks, err := client.GetPlaylistTracks(user.ID, pl.ID)
ptracks, err := client.GetPlaylistTracks(pl.ID)
for _, t := range ptracks.Tracks {
if rmTrackName == t.Track.SimpleTrack.Name {
matchedTrack = t.Track.SimpleTrack
Expand All @@ -429,7 +429,7 @@ func rmTrackByNameFromPlaylist(cmd *cobra.Command, args []string) error {
fmt.Println("Track: ", matchedTrack.Name)

// remove track from playlist
_, err = client.RemoveTracksFromPlaylist(user.ID, pl.ID, matchedTrack.ID)
_, err = client.RemoveTracksFromPlaylist(pl.ID, matchedTrack.ID)
if err != nil {
Comment on lines +432 to 433
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_, err = client.RemoveTracksFromPlaylist(pl.ID, matchedTrack.ID)
if err != nil {
if _, err = client.RemoveTracksFromPlaylist(pl.ID, matchedTrack.ID); err != nil {

return err
}
Expand All @@ -451,7 +451,7 @@ func listTracksFromPlaylist(cmd *cobra.Command, args []string) error {
}

// get tracks from playlist
tracks, err := client.GetPlaylistTracks(user.ID, pl.ID)
tracks, err := client.GetPlaylistTracks(pl.ID)
if err != nil {
return err
}
Expand Down Expand Up @@ -485,7 +485,7 @@ func getPlaylists() (*spotify.SimplePlaylistPage, error) {
return &(spotify.SimplePlaylistPage{}), err
}

return playlists, nil
return playlists, nil
}

func getPlaylistByName(playlistName string) (spotify.SimplePlaylist, error) {
Expand Down
14 changes: 14 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module github.com/masroorhasan/spotifycli

go 1.15

require (
github.com/agext/uuid v1.0.1
github.com/bndr/gotabulate v1.1.2
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.1 // indirect
github.com/stretchr/testify v1.6.1 // indirect
github.com/zmb3/spotify v0.0.0-20200814173021-9bec46940cc0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
)
36 changes: 36 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/agext/uuid v1.0.1 h1:Za6toqrdwQwHJzTfsgt3JaPuQ2xeYuak6N0513NdFeQ=
github.com/agext/uuid v1.0.1/go.mod h1:S35kGCagARSdmRVLoWmwmevvhFsiZkmtEqdw4hcDePs=
github.com/bndr/gotabulate v1.1.2 h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c=
github.com/bndr/gotabulate v1.1.2/go.mod h1:0+8yUgaPTtLRTjf49E8oju7ojpU11YmXyvq1LbPAb3U=
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/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/zmb3/spotify v0.0.0-20200814173021-9bec46940cc0 h1:5EK/om56mgVbJOAqJrAI6XtjEqYCTousMfurjHXDHuE=
github.com/zmb3/spotify v0.0.0-20200814173021-9bec46940cc0/go.mod h1:CYu0Uo+YYMlUX39zUTsCU9j3SpK3l1eB8oLykXF7R7w=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 0 additions & 2 deletions vendor/github.com/agext/uuid/.gitignore

This file was deleted.

70 changes: 0 additions & 70 deletions vendor/github.com/agext/uuid/.travis.yml

This file was deleted.

36 changes: 0 additions & 36 deletions vendor/github.com/agext/uuid/DCO

This file was deleted.

Loading