mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Added floating panel of playing playlist for scheduled audio files.
This commit is contained in:
parent
348cf4829c
commit
af7ea90246
3 changed files with 18 additions and 3 deletions
|
@ -70,7 +70,22 @@ rpl::producer<SparseIdsMergedSlice> AbstractController::mediaSource(
|
|||
int limitAfter) const {
|
||||
Expects(peer() != nullptr);
|
||||
|
||||
return SharedMediaMergedViewer(
|
||||
const auto isScheduled = [&] {
|
||||
if (IsServerMsgId(aroundId)) {
|
||||
return false;
|
||||
}
|
||||
const auto channelId = peerToChannel(peer()->id);
|
||||
if (const auto item = session().data().message(channelId, aroundId)) {
|
||||
return item->isScheduled();
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
auto mediaViewer = isScheduled
|
||||
? SharedScheduledMediaViewer
|
||||
: SharedMediaMergedViewer;
|
||||
|
||||
return mediaViewer(
|
||||
&session(),
|
||||
SharedMediaMergedKey(
|
||||
SparseIdsMergedSlice::Key(
|
||||
|
|
|
@ -913,7 +913,7 @@ SparseIdsMergedSlice::Key ListWidget::sliceKey(
|
|||
|
||||
void ListWidget::refreshViewer() {
|
||||
_viewerLifetime.destroy();
|
||||
auto idForViewer = sliceKey(_universalAroundId).universalId;
|
||||
const auto idForViewer = sliceKey(_universalAroundId).universalId;
|
||||
_controller->mediaSource(
|
||||
idForViewer,
|
||||
_idsLimit,
|
||||
|
|
|
@ -244,7 +244,7 @@ void Panel::refreshList() {
|
|||
const auto document = media ? media->document() : nullptr;
|
||||
if (!document
|
||||
|| !document->isSharedMediaMusic()
|
||||
|| !IsServerMsgId(item->id)) {
|
||||
|| (!IsServerMsgId(item->id) && !item->isScheduled())) {
|
||||
return nullptr;
|
||||
}
|
||||
const auto result = item->history()->peer;
|
||||
|
|
Loading…
Add table
Reference in a new issue