Some formatting
This commit is contained in:
parent
e7afe60331
commit
bd51c1d6d4
19
song.go
19
song.go
|
@ -9,17 +9,17 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
//"github.com/layeh/gumble/gumble_ffmpeg"
|
//"github.com/layeh/gumble/gumble_ffmpeg"
|
||||||
"os/exec"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Song struct {
|
type Song struct {
|
||||||
submitter string
|
submitter string
|
||||||
title string
|
title string
|
||||||
youtubeId string
|
youtubeId string
|
||||||
duration string
|
duration string
|
||||||
thumbnailUrl string
|
thumbnailUrl string
|
||||||
skippers []string
|
skippers []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSong(user, id string) *Song {
|
func NewSong(user, id string) *Song {
|
||||||
|
@ -48,7 +48,7 @@ func (s *Song) Delete() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Song) AddSkip(username string) bool {
|
func (s *Song) AddSkip(username string) bool {
|
||||||
for _,user := range s.skippers {
|
for _, user := range s.skippers {
|
||||||
if username == user {
|
if username == user {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ func (s *Song) AddSkip(username string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Song) RemoveSkip(username string) bool {
|
func (s *Song) RemoveSkip(username string) bool {
|
||||||
for i,user := range s.skippers {
|
for i, user := range s.skippers {
|
||||||
if username == user {
|
if username == user {
|
||||||
s.skippers = append(s.skippers[:i], s.skippers[i+1:]...)
|
s.skippers = append(s.skippers[:i], s.skippers[i+1:]...)
|
||||||
return true
|
return true
|
||||||
|
@ -67,3 +67,6 @@ func (s *Song) RemoveSkip(username string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Song) SkipReached(channelUsers int) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
Reference in a new issue