From 2f0fd398d55e56cc91386e2e4c3d8131f73200a7 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 8 Jun 2021 04:14:54 +0300 Subject: [PATCH] Fixed update of availability of next and previous tracks in SMC. --- .../SourceFiles/window/system_media_controls_manager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/window/system_media_controls_manager.cpp b/Telegram/SourceFiles/window/system_media_controls_manager.cpp index d6c456b984..c127ae7f02 100644 --- a/Telegram/SourceFiles/window/system_media_controls_manager.cpp +++ b/Telegram/SourceFiles/window/system_media_controls_manager.cpp @@ -163,6 +163,13 @@ SystemMediaControlsManager::SystemMediaControlsManager( _lastAudioMsgId = current; }, _lifetime); + mediaPlayer->playlistChanges( + type + ) | rpl::start_with_next([=] { + _controls->setIsNextEnabled(mediaPlayer->nextAvailable(type)); + _controls->setIsPreviousEnabled(mediaPlayer->previousAvailable(type)); + }, _lifetime); + _controls->commandRequests( ) | rpl::start_with_next([=](Command command) { switch (command) {