Make logging statements clearer

This commit is contained in:
RichardNysater 2017-06-04 02:36:04 +02:00
parent b6d8ec7510
commit a9e0a50942
2 changed files with 4 additions and 3 deletions

View file

@ -272,7 +272,7 @@ func (q *Queue) PlayCurrent() error {
currentTrack := q.GetTrack(0)
filepath := os.ExpandEnv(viper.GetString("cache.directory") + "/" + currentTrack.GetFilename())
if _, err := os.Stat(filepath); os.IsNotExist(err) {
logrus.Infoln("Downloading track...")
logrus.Infoln("Track does not exist, need to download it...")
if err := DJ.YouTubeDL.Download(q.GetTrack(0)); err != nil {
return err
}

View file

@ -45,11 +45,12 @@ func (yt *YouTubeDL) Download(t interfaces.Track) error {
var cmd *exec.Cmd
logrus.WithFields(logrus.Fields{
"url": t.GetURL(),
"target filepath": filepath,
"download-path": filepath,
"format" : format,
"player" : player,
}).Infoln("Downloading song...")
}).Infoln("Downloading track...")
if t.GetService() == "Mixcloud" {
logrus.Infoln("Downloading from Mixcloud...")
cmd = exec.Command("youtube-dl", "--verbose", "--no-mtime", "--output", filepath, "--format", format, "--external-downloader", "aria2c", player, t.GetURL())
} else {
cmd = exec.Command("youtube-dl", "--verbose", "--no-mtime", "--output", filepath, "--format", format, player, t.GetURL())