update:sync mpv closing with discord status
This commit is contained in:
6
main.go
6
main.go
@@ -87,7 +87,7 @@ func isInMusicFolder(fp string, musicFolders []string) bool {
|
||||
func main() {
|
||||
var connected bool
|
||||
var lastSong string
|
||||
config, _:= config.GetConfig()
|
||||
config, _ := config.GetConfig()
|
||||
for {
|
||||
if _, err := os.Stat(SOCKET_PATH); err == nil {
|
||||
if !connected {
|
||||
@@ -122,6 +122,10 @@ func main() {
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("✗ Connection broken, restart mpv to reconnect: %v\n", err)
|
||||
if connected {
|
||||
client.Logout()
|
||||
connected = false
|
||||
}
|
||||
}
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user