forked from quickshell/quickshell
		
	service/mpris: fix position being incorrect after pausing
This commit is contained in:
		
							parent
							
								
									ed3708f5cb
								
							
						
					
					
						commit
						f2df3da596
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -312,8 +312,11 @@ void MprisPlayer::onPlaybackStatusChanged() {
 | 
				
			||||||
	const auto& status = this->pPlaybackStatus.get();
 | 
						const auto& status = this->pPlaybackStatus.get();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (status == "Playing") {
 | 
						if (status == "Playing") {
 | 
				
			||||||
 | 
							// update the timestamp
 | 
				
			||||||
 | 
							this->onSeek(this->positionMs() * 1000);
 | 
				
			||||||
		this->mPlaybackState = MprisPlaybackState::Playing;
 | 
							this->mPlaybackState = MprisPlaybackState::Playing;
 | 
				
			||||||
	} else if (status == "Paused") {
 | 
						} else if (status == "Paused") {
 | 
				
			||||||
 | 
							this->pausedTime = QDateTime::currentDateTimeUtc();
 | 
				
			||||||
		this->mPlaybackState = MprisPlaybackState::Paused;
 | 
							this->mPlaybackState = MprisPlaybackState::Paused;
 | 
				
			||||||
	} else if (status == "Stopped") {
 | 
						} else if (status == "Stopped") {
 | 
				
			||||||
		this->mPlaybackState = MprisPlaybackState::Stopped;
 | 
							this->mPlaybackState = MprisPlaybackState::Stopped;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue