mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-28 11:30:54 +00:00
Beta version 1.7.4: Use loadedInMediaCache for songs.
This commit is contained in:
parent
961fd1dbab
commit
c7b1683f6e
@ -395,10 +395,16 @@ void Instance::playStreamed(
|
||||
data->streamed->player.updates(
|
||||
) | rpl::start_with_next_error([=](Streaming::Update &&update) {
|
||||
handleStreamingUpdate(data, std::move(update));
|
||||
}, [=](Streaming::Error && error) {
|
||||
}, [=](Streaming::Error &&error) {
|
||||
handleStreamingError(data, std::move(error));
|
||||
}, data->streamed->player.lifetime());
|
||||
|
||||
data->streamed->player.fullInCache(
|
||||
) | rpl::start_with_next([=](bool fullInCache) {
|
||||
const auto document = data->streamed->id.audio();
|
||||
document->setLoadedInMediaCache(fullInCache);
|
||||
}, data->streamed->player.lifetime());
|
||||
|
||||
data->streamed->player.play(streamingOptions(audioId));
|
||||
|
||||
emitUpdate(audioId.type());
|
||||
|
@ -1986,6 +1986,7 @@ void OverlayWidget::initStreaming() {
|
||||
createStreamingObjects();
|
||||
|
||||
Core::App().updateNonIdle();
|
||||
|
||||
_streamed->player.updates(
|
||||
) | rpl::start_with_next_error([=](Streaming::Update &&update) {
|
||||
handleStreamingUpdate(std::move(update));
|
||||
|
@ -1088,7 +1088,9 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
||||
}
|
||||
|
||||
void Document::drawCornerDownload(Painter &p, bool selected, const PaintContext *context) const {
|
||||
if (_data->loaded() || !downloadInCorner()) {
|
||||
if (_data->loaded()
|
||||
|| _data->loadedInMediaCache()
|
||||
|| !downloadInCorner()) {
|
||||
return;
|
||||
}
|
||||
const auto size = st::overviewSmallCheck.size;
|
||||
@ -1124,7 +1126,9 @@ TextState Document::cornerDownloadTextState(
|
||||
QPoint point,
|
||||
StateRequest request) const {
|
||||
auto result = TextState(parent());
|
||||
if (!downloadInCorner() || _data->loaded()) {
|
||||
if (!downloadInCorner()
|
||||
|| _data->loaded()
|
||||
|| _data->loadedInMediaCache()) {
|
||||
return result;
|
||||
}
|
||||
const auto size = st::overviewSmallCheck.size;
|
||||
@ -1163,7 +1167,8 @@ TextState Document::getState(
|
||||
_st.songThumbSize,
|
||||
_width);
|
||||
if (inner.contains(point)) {
|
||||
const auto link = (_data->loading() || _data->uploading())
|
||||
const auto link = (!downloadInCorner()
|
||||
&& (_data->loading() || _data->uploading()))
|
||||
? _cancell
|
||||
: (loaded || _data->canBePlayed())
|
||||
? _openl
|
||||
|
Loading…
Reference in New Issue
Block a user