about summary refs log tree commit diff
path: root/tools/mpd-stats/cmd/mpd-scrobbler/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mpd-stats/cmd/mpd-scrobbler/main.go')
-rw-r--r--tools/mpd-stats/cmd/mpd-scrobbler/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/mpd-stats/cmd/mpd-scrobbler/main.go b/tools/mpd-stats/cmd/mpd-scrobbler/main.go
index 3953123..ba7bb05 100644
--- a/tools/mpd-stats/cmd/mpd-scrobbler/main.go
+++ b/tools/mpd-stats/cmd/mpd-scrobbler/main.go
@@ -16,8 +16,11 @@ func main() {
 		log.Fatalf("failed to create a client: %v", err)
 	}
 
-	defer c.Watcher.Close()
-	defer c.Client.Close()
+	defer func() {
+		if err := c.Close(); err != nil {
+			log.Fatalf("failed to close the player: %v", err)
+		}
+	}()
 
 	var (
 		currentRecord  *scrobbler.Record