mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +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) {
|
if (!current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((_lastAudioMsgId.contextId() == current.contextId())
|
||||||
|
&& (_lastAudioMsgId.audio() == current.audio())
|
||||||
|
&& (_lastAudioMsgId.type() == current.type())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const auto document = current.audio();
|
const auto document = current.audio();
|
||||||
|
|
||||||
const auto &[title, performer] = Ui::Text::FormatSongNameFor(document)
|
const auto &[title, performer] = Ui::Text::FormatSongNameFor(document)
|
||||||
|
@ -156,6 +161,8 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
||||||
} else {
|
} else {
|
||||||
_controls->clearThumbnail();
|
_controls->clearThumbnail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_lastAudioMsgId = current;
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
|
|
||||||
_controls->commandRequests(
|
_controls->commandRequests(
|
||||||
|
|
|
@ -32,6 +32,7 @@ private:
|
||||||
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
||||||
|
|
||||||
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
||||||
|
AudioMsgId _lastAudioMsgId;
|
||||||
|
|
||||||
rpl::lifetime _lifetimeDownload;
|
rpl::lifetime _lifetimeDownload;
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
|
Loading…
Add table
Reference in a new issue