From aa60f2bad77566d8606ceb2c778b8e3bce771643 Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Sat, 10 Jan 2015 12:32:27 -0800 Subject: [PATCH] Fix https://github.com/matthieugrieger/mumbledj/issues/16: Type mismatch on make --- commands.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/commands.go b/commands.go index fc0aa9e..034abfa 100644 --- a/commands.go +++ b/commands.go @@ -153,17 +153,15 @@ func add(user *gumble.User, username, url string) { if re.MatchString(url) { if dj.HasPermission(username, dj.conf.Permissions.AdminAddPlaylists) { shortUrl = re.FindStringSubmatch(url)[1] - if shortUrl != nil { - newPlaylist := NewPlaylist(username, shortUrl) - if dj.queue.AddItem(newPlaylist); err == nil { - dj.client.Self().Channel().Send(fmt.Sprintf(PLAYLIST_ADDED_HTML, username, newPlaylist.title), false) - if dj.queue.Len() == 1 && !dj.audioStream.IsPlaying() { - if err := dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Download(); err == nil { - dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Play() - } else { - user.Send(AUDIO_FAIL_MSG) - dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Delete() - } + newPlaylist := NewPlaylist(username, shortUrl) + if dj.queue.AddItem(newPlaylist); err == nil { + dj.client.Self().Channel().Send(fmt.Sprintf(PLAYLIST_ADDED_HTML, username, newPlaylist.title), false) + if dj.queue.Len() == 1 && !dj.audioStream.IsPlaying() { + if err := dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Download(); err == nil { + dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Play() + } else { + user.Send(AUDIO_FAIL_MSG) + dj.queue.CurrentItem().(*Playlist).songs.CurrentItem().(*Song).Delete() } } }