Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Commit

Permalink
Fix #176: Empty IDs for SoundCloud tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugrieger committed Aug 23, 2016
1 parent 9222608 commit 51db9c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
MumbleDJ Changelog
==================

### August 22, 2016 -- `v3.1.4`
* Fixed a SoundCloud API response parsing issue that would result in empty IDs for tracks.
* Fixed the startup check for SoundCloud API.

### August 21, 2016 -- `v3.1.3`
* Fixed a deadlock that would occur during the transition from the first to second track in a queue.

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
services.DJ = DJ
bot.DJ = DJ

DJ.Version = "v3.1.3"
DJ.Version = "v3.1.4"

logrus.SetLevel(logrus.WarnLevel)
}
Expand Down
5 changes: 3 additions & 2 deletions services/soundcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (sc *SoundCloud) CheckAPIKey() error {
if viper.GetString("api_keys.soundcloud") == "" {
return errors.New("No SoundCloud API key has been provided")
}
url := "http://api.soundcloud.com/tracks/vjflzpbkmerb?client_id=%s"
url := "http://api.soundcloud.com/tracks/13158665?client_id=%s"
response, err := http.Get(fmt.Sprintf(url, viper.GetString("api_keys.soundcloud")))
defer response.Body.Close()
if err != nil {
Expand Down Expand Up @@ -162,7 +162,8 @@ func (sc *SoundCloud) GetTracks(url string, submitter *gumble.User) ([]interface

func (sc *SoundCloud) getTrack(obj *jason.Object, offset time.Duration, submitter *gumble.User) (bot.Track, error) {
title, _ := obj.GetString("title")
id, _ := obj.GetString("id")
idInt, _ := obj.GetInt64("id")
id := strconv.FormatInt(idInt, 10)
url, _ := obj.GetString("permalink_url")
author, _ := obj.GetString("user", "username")
authorURL, _ := obj.GetString("user", "permalink_url")
Expand Down

0 comments on commit 51db9c3

Please sign in to comment.