update:sync mpv closing with discord status

This commit is contained in:
kokopi-dev
2025-12-21 21:08:02 +09:00
parent e671ad2cde
commit 977d4db39a

View File

@@ -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)