mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Fixed track change notification in media player.
This commit is contained in:
parent
3c86da78af
commit
b553520a48
2 changed files with 8 additions and 0 deletions
|
@ -129,6 +129,11 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
|||
if (!current) {
|
||||
return;
|
||||
}
|
||||
if ((_lastAudioMsgId.contextId() == current.contextId())
|
||||
&& (_lastAudioMsgId.audio() == current.audio())
|
||||
&& (_lastAudioMsgId.type() == current.type())) {
|
||||
return;
|
||||
}
|
||||
const auto document = current.audio();
|
||||
|
||||
const auto &[title, performer] = Ui::Text::FormatSongNameFor(document)
|
||||
|
@ -156,6 +161,8 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
|||
} else {
|
||||
_controls->clearThumbnail();
|
||||
}
|
||||
|
||||
_lastAudioMsgId = current;
|
||||
}, _lifetime);
|
||||
|
||||
_controls->commandRequests(
|
||||
|
|
|
@ -32,6 +32,7 @@ private:
|
|||
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
||||
|
||||
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
||||
AudioMsgId _lastAudioMsgId;
|
||||
|
||||
rpl::lifetime _lifetimeDownload;
|
||||
rpl::lifetime _lifetime;
|
||||
|
|
Loading…
Add table
Reference in a new issue