remove unneeded assignment
This commit is contained in:
parent
4e4c6b3d69
commit
3cf7387c12
16
main.go
16
main.go
|
@ -32,13 +32,15 @@ func main() {
|
||||||
log.Fatalf("Authentication failed, password %v absent or incorrect.", password)
|
log.Fatalf("Authentication failed, password %v absent or incorrect.", password)
|
||||||
}
|
}
|
||||||
defer client.Disconnect()
|
defer client.Disconnect()
|
||||||
params := sceneitems.NewGetSceneItemListParams().WithSceneName("cmus")
|
cmusParams := sceneitems.NewGetSceneItemListParams().WithSceneName("cmus")
|
||||||
scil, err := client.SceneItems.GetSceneItemList(params)
|
scil, err := client.SceneItems.GetSceneItemList(cmusParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// i should force create the scene if it does not exist. but this is solely for me.
|
// i should force create the scene if it does not exist. but this is solely for me.
|
||||||
// failing in this way is probably smarter since it forces to arrange the scene how i want it.
|
// failing in this way is probably smarter since it forces to arrange the scene how i want it.
|
||||||
log.Fatalf("Expecting a scene named \"cmus\", but the scene was not found.\n%v", err.Error())
|
log.Fatalf("Expecting a scene named \"cmus\", but the scene was not found.\n%v", err.Error())
|
||||||
}
|
}
|
||||||
|
var prevPath string
|
||||||
|
for {
|
||||||
out, err := CmusRemoteOutput()
|
out, err := CmusRemoteOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("%v\nCmus is likely not running.", err.Error())
|
log.Fatalf("%v\nCmus is likely not running.", err.Error())
|
||||||
|
@ -47,16 +49,6 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err.Error())
|
log.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
var prevPath string
|
|
||||||
for {
|
|
||||||
out, err = CmusRemoteOutput()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("%v\nCmus is likely not running.", err.Error())
|
|
||||||
}
|
|
||||||
path, err = getAttribute(out, "file ")
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err.Error())
|
|
||||||
}
|
|
||||||
if path != prevPath {
|
if path != prevPath {
|
||||||
artist, err := getAttribute(out, "tag artist ", "tag albumartist ", "tag composer ")
|
artist, err := getAttribute(out, "tag artist ", "tag albumartist ", "tag composer ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue