diff --git a/service_soundcloud.go b/service_soundcloud.go index 48ebbb1..af3f077 100644 --- a/service_soundcloud.go +++ b/service_soundcloud.go @@ -66,9 +66,9 @@ func (sc SoundCloud) NewRequest(user *gumble.User, url string) (string, error) { // Calculating offset offset := 0 timesplit := strings.Split(url, "#t=") - if timesplit.Size == 2 { + if len(timesplit) == 2 { duration, _ := time.ParseDuration(timesplit[1]) - offset = duration.Seconds() + offset = int(duration.Seconds()) } return sc.NewSong(user, apiResponse, offset, nil) @@ -91,7 +91,7 @@ func (sc SoundCloud) NewSong(user *gumble.User, trackData *jsonq.JsonQuery, offs // Check song is not longer than the MaxSongDuration if dj.conf.General.MaxSongDuration == 0 || (durationMS/1000) <= dj.conf.General.MaxSongDuration { timeDuration, _ := time.ParseDuration(strconv.Itoa(durationMS) + "ms") - duration = strings.NewReplacer("h", ":", "m", ":", "s", ":").Replace(timeDuration.String()) + duration := strings.NewReplacer("h", ":", "m", ":", "s", ":").Replace(timeDuration.String()) song := &YouTubeSong{ id: strconv.Itoa(id),