From f2df3da596adf3b42a36759ed09d0cc8d4bc46f8 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 22 May 2024 04:34:56 -0700 Subject: [PATCH] service/mpris: fix position being incorrect after pausing --- src/services/mpris/player.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/mpris/player.cpp b/src/services/mpris/player.cpp index ebdbfd64..1bb9f7be 100644 --- a/src/services/mpris/player.cpp +++ b/src/services/mpris/player.cpp @@ -312,8 +312,11 @@ void MprisPlayer::onPlaybackStatusChanged() { const auto& status = this->pPlaybackStatus.get(); if (status == "Playing") { + // update the timestamp + this->onSeek(this->positionMs() * 1000); this->mPlaybackState = MprisPlaybackState::Playing; } else if (status == "Paused") { + this->pausedTime = QDateTime::currentDateTimeUtc(); this->mPlaybackState = MprisPlaybackState::Paused; } else if (status == "Stopped") { this->mPlaybackState = MprisPlaybackState::Stopped;