diff --git a/service.go b/service.go index 32a36c1..480634d 100644 --- a/service.go +++ b/service.go @@ -89,14 +89,14 @@ func FindServiceAndAdd(user *gumble.User, url string) error { // Loop through all songs and add to the queue oldLength := dj.queue.Len() - for song := range songArray { + for songToAdd := range songArray { // Check song is not too long - time, _ := time.ParseDuration(song.Duration()) + time, _ := time.ParseDuration(songToAdd.Duration) if dj.conf.General.MaxSongDuration == 0 || int(time.Seconds()) <= dj.conf.General.MaxSongDuration { - if !isNil(song.Playlist()) { - title = song.Playlist().Title() + if !isNil(songToAdd.Playlist()) { + title = songToAdd.Playlist().Title() } else { - title = song.Title() + title = songToAdd.Title() } // Add song to queue diff --git a/youtube_dl.go b/youtube_dl.go index 64d60b1..b2ae282 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -28,7 +28,7 @@ type YouTubeSong struct { title string thumbnail string submitter *gumble.User - duration int + Duration int url string offset int format string @@ -74,7 +74,7 @@ func (dl *YouTubeSong) Download() error { } // Play plays the song. Once the song is playing, a notification is displayed in a text message that features the song -// thumbnail, URL, title, duration, and submitter. +// thumbnail, URL, title, Duration, and submitter. func (dl *YouTubeSong) Play() { if dl.offset != 0 { offsetDuration, _ := time.ParseDuration(fmt.Sprintf("%ds", dl.offset)) @@ -85,7 +85,7 @@ func (dl *YouTubeSong) Play() { panic(err) } else { message := `
%s (%s) |
Added by %s |
From playlist "%s" |