From 8604bae69ca98a1c8c002418cf2117e8a44eaf78 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Mon, 27 Jul 2015 23:00:32 +0100 Subject: [PATCH] Fixing build issues --- main.go | 3 --- service.go | 2 ++ service_youtube.go | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 6f7e2ab..ab41f9a 100644 --- a/main.go +++ b/main.go @@ -148,14 +148,11 @@ var dj = mumbledj{ cache: NewSongCache(), } -var services []Service - // main primarily performs startup tasks. Grabs and parses commandline // args, sets up the gumble client and its listeners, and then connects to the server. func main() { PerformStartupChecks() - services = []Service{new(Youtube)} if currentUser, err := user.Current(); err == nil { dj.homeDir = currentUser.HomeDir diff --git a/service.go b/service.go index 4c4a03b..541605b 100644 --- a/service.go +++ b/service.go @@ -48,3 +48,5 @@ type Playlist interface { ID() string Title() string } + +var services = []Service{YouTube{}} diff --git a/service_youtube.go b/service_youtube.go index 18f8f6d..f36050b 100644 --- a/service_youtube.go +++ b/service_youtube.go @@ -33,12 +33,12 @@ type YouTube struct { } // Name of the service -func (y Youtube) ServiceName() string { +func (y YouTube) ServiceName() string { return "Youtube" } // Checks to see if service will accept URL -func (y Youtube) URLRegex(url string) bool { +func (y YouTube) URLRegex(url string) bool { youtubePatterns := []string{ `https?:\/\/www\.youtube\.com\/watch\?v=([\w-]+)(\&t=\d*m?\d*s?)?`, `https?:\/\/youtube\.com\/watch\?v=([\w-]+)(\&t=\d*m?\d*s?)?`, @@ -62,7 +62,7 @@ func (y Youtube) URLRegex(url string) bool { } // Creates the requested song/playlist and adds to the queue -func (y Youtube) NewRequest(user *gumble.User, url string) { +func (y YouTube) NewRequest(user *gumble.User, url string) { }