From 876ac22ee1c57c6df7354bdecec7bde9e4144fa2 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Sun, 6 Apr 2025 17:29:37 -0700 Subject: [PATCH] WindowsSMTC: Use playback status' track duration --- backend/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app.go b/backend/app.go index f76a58b..9e0183c 100644 --- a/backend/app.go +++ b/backend/app.go @@ -403,8 +403,8 @@ func (a *App) SetupWindowsSMTC(hwnd uintptr) { }() }) a.PlaybackManager.OnSeek(func() { - dur := a.PlaybackManager.NowPlaying().Metadata().Duration - smtc.UpdatePosition(int(a.PlaybackManager.PlaybackStatus().TimePos*1000), dur*1000) + playbackStatus := a.PlaybackManager.PlaybackStatus() + smtc.UpdatePosition(int(playbackStatus.TimePos*1000), int(playbackStatus.Duration*1000)) }) a.PlaybackManager.OnPlaying(func() { smtc.SetEnabled(true)