Fix https://github.com/matthieugrieger/mumbledj/issues/16: Type mismatch on make
This commit is contained in:
parent
7fe12c4e43
commit
aa60f2bad7
20
commands.go
20
commands.go
|
@ -153,17 +153,15 @@ func add(user *gumble.User, username, url string) {
|
||||||
if re.MatchString(url) {
|
if re.MatchString(url) {
|
||||||
if dj.HasPermission(username, dj.conf.Permissions.AdminAddPlaylists) {
|
if dj.HasPermission(username, dj.conf.Permissions.AdminAddPlaylists) {
|
||||||
shortUrl = re.FindStringSubmatch(url)[1]
|
shortUrl = re.FindStringSubmatch(url)[1]
|
||||||
if shortUrl != nil {
|
newPlaylist := NewPlaylist(username, shortUrl)
|
||||||
newPlaylist := NewPlaylist(username, shortUrl)
|
if dj.queue.AddItem(newPlaylist); err == nil {
|
||||||
if dj.queue.AddItem(newPlaylist); err == nil {
|
dj.client.Self().Channel().Send(fmt.Sprintf(PLAYLIST_ADDED_HTML, username, newPlaylist.title), false)
|
||||||
dj.client.Self().Channel().Send(fmt.Sprintf(PLAYLIST_ADDED_HTML, username, newPlaylist.title), false)
|
if dj.queue.Len() == 1 && !dj.audioStream.IsPlaying() {
|
||||||
if dj.queue.Len() == 1 && !dj.audioStream.IsPlaying() {
|
if err := dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Download(); err == nil {
|
||||||
if err := dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Download(); err == nil {
|
dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Play()
|
||||||
dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Play()
|
} else {
|
||||||
} else {
|
user.Send(AUDIO_FAIL_MSG)
|
||||||
user.Send(AUDIO_FAIL_MSG)
|
dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Delete()
|
||||||
dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Delete()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue