Fixing build errors

This commit is contained in:
MichaelOultram 2015-09-26 15:57:17 +01:00
parent dc5741cf86
commit df35d03ebe
4 changed files with 6 additions and 7 deletions

View file

@ -37,7 +37,7 @@ type Song interface {
Title() string Title() string
ID() string ID() string
Filename() string Filename() string
Duration() string DurationString() string
Thumbnail() string Thumbnail() string
Playlist() Playlist Playlist() Playlist
DontSkip() bool DontSkip() bool

View file

@ -13,7 +13,6 @@ import (
"os" "os"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/jmoiron/jsonq" "github.com/jmoiron/jsonq"
"github.com/layeh/gumble/gumble" "github.com/layeh/gumble/gumble"
@ -115,7 +114,7 @@ func (sc SoundCloud) NewSong(user *gumble.User, trackData *jsonq.JsonQuery, offs
url: url, url: url,
thumbnail: thumbnail, thumbnail: thumbnail,
submitter: user, submitter: user,
duration: durationMS / 1000, Duration: durationMS / 1000,
offset: offset, offset: offset,
format: "mp3", format: "mp3",
playlist: playlist, playlist: playlist,

View file

@ -91,7 +91,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis
id: id, id: id,
url: "https://youtu.be/" + id, url: "https://youtu.be/" + id,
offset: int(yt.parseTime(offset).Seconds()), offset: int(yt.parseTime(offset).Seconds()),
duration: int(yt.parseTime(duration).Seconds()), Duration: int(yt.parseTime(duration).Seconds()),
thumbnail: thumbnail, thumbnail: thumbnail,
format: "m4a", format: "m4a",
skippers: make([]string, 0), skippers: make([]string, 0),
@ -132,11 +132,11 @@ func (yt YouTube) parseTime(duration string) time.Duration {
seconds, _ = strconv.ParseInt(strings.TrimSuffix(timestampResult["seconds"], "S"), 10, 32) seconds, _ = strconv.ParseInt(strings.TrimSuffix(timestampResult["seconds"], "S"), 10, 32)
} }
totalSeconds = int((days * 86400) + (hours * 3600) + (minutes * 60) + seconds) totalSeconds = int64((days * 86400) + (hours * 3600) + (minutes * 60) + seconds)
} else { } else {
totalSeconds = 0 totalSeconds = 0
} }
return time.ParseDuration(totalSeconds + "s") return time.ParseDuration(strconv.Itoa(totalSeconds) + "s")
} }
// NewPlaylist gathers the metadata for a YouTube playlist and returns it. // NewPlaylist gathers the metadata for a YouTube playlist and returns it.

View file

@ -15,9 +15,9 @@ import (
"net/http" "net/http"
"os" "os"
"os/exec" "os/exec"
"strconv"
"time" "time"
"github.com/jmoiron/jsonq"
"github.com/layeh/gumble/gumble" "github.com/layeh/gumble/gumble"
"github.com/layeh/gumble/gumble_ffmpeg" "github.com/layeh/gumble/gumble_ffmpeg"
) )