1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Use WTF's version of spotigopher (#787)

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer 2019-12-14 21:24:18 -08:00 committed by GitHub
parent 53e795384b
commit b7f8ec5ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

2
go.mod
View File

@ -44,8 +44,8 @@ require (
github.com/radovskyb/watcher v1.0.7
github.com/rivo/tview v0.0.0-20190829161255-f8bc69b90341
github.com/shirou/gopsutil v2.19.11+incompatible
github.com/sticreations/spotigopher v0.0.0-20181009182052-98632f6f94b0
github.com/stretchr/testify v1.4.0
github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a
github.com/wtfutil/todoist v0.0.1
github.com/xanzy/go-gitlab v0.22.2
github.com/zmb3/spotify v0.0.0-20191010212056-e12fb981aacb

4
go.sum
View File

@ -239,8 +239,6 @@ github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzu
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/sticreations/spotigopher v0.0.0-20181009182052-98632f6f94b0 h1:WWyBZL7bRdl7Do39EvkJmBFXT11uXLACy0cJHHOZ7IE=
github.com/sticreations/spotigopher v0.0.0-20181009182052-98632f6f94b0/go.mod h1:DjuRbAVIoxD4Lv7aE12Km2XYYYKrtXXNbpivYwXv2HE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
@ -250,6 +248,8 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a h1:2eyMT9EpTPS4PiVfvXvqA8PKB5FoSl6gGjgb3CQ0cug=
github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a/go.mod h1:AlO4kKlF1zyOHTq2pBzxEERdBDStJev0VZNukFEqz/E=
github.com/wtfutil/todoist v0.0.1 h1:E3srzocggLHme8zIEAEXXoY/fQZtFRjW69m4OiYv3hg=
github.com/wtfutil/todoist v0.0.1/go.mod h1:YuuGLJSsTK6DGBD5Zaf3J8LSMfpEC2WtzYPey3XVOdI=
github.com/xanzy/go-gitlab v0.22.2 h1:KYPewSm3Tl7WHrVON7BOwX6FZ1gaiFEdpOt0DNIYySA=

View File

@ -4,7 +4,7 @@ import (
"fmt"
"github.com/rivo/tview"
"github.com/sticreations/spotigopher/spotigopher"
"github.com/wtfutil/spotigopher/spotigopher"
"github.com/wtfutil/wtf/utils"
"github.com/wtfutil/wtf/view"
)

View File

@ -2,6 +2,7 @@ package spotigopher
import (
"errors"
"fmt"
"log"
"os/exec"
"runtime"
@ -161,10 +162,13 @@ func getDarwinInfo(infoType string) string {
default:
args = []string{`-etell application "Spotify" to name of current track as string`}
}
info, err := exec.Command("osascript", args...).Output()
if err != nil {
log.Fatalf("Could not get info: %s", infoType)
// There is likely no current track yet, inform the user
return fmt.Sprintf("Could not get info for: %s", infoType)
}
return strings.Trim(string(info), "\n")
}

4
vendor/modules.txt vendored
View File

@ -260,10 +260,10 @@ github.com/shirou/gopsutil/internal/common
github.com/shirou/gopsutil/mem
# github.com/spf13/pflag v1.0.3
github.com/spf13/pflag
# github.com/sticreations/spotigopher v0.0.0-20181009182052-98632f6f94b0
github.com/sticreations/spotigopher/spotigopher
# github.com/stretchr/testify v1.4.0
github.com/stretchr/testify/assert
# github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a
github.com/wtfutil/spotigopher/spotigopher
# github.com/wtfutil/todoist v0.0.1
github.com/wtfutil/todoist
# github.com/xanzy/go-gitlab v0.22.2