| 534 | } |
| 535 | |
| 536 | void PhotoData::loadVideo(Data::PhotoSize size, Data::FileOrigin origin) { |
| 537 | if (!_videoSizes) { |
| 538 | return; |
| 539 | } |
| 540 | const auto autoLoading = false; |
| 541 | const auto finalCheck = [=] { |
| 542 | if (const auto active = activeMediaView()) { |
| 543 | return active->videoContent(size).isEmpty(); |
| 544 | } |
| 545 | return true; |
| 546 | }; |
| 547 | const auto done = [=](QByteArray result) { |
| 548 | if (const auto active = activeMediaView()) { |
| 549 | active->setVideo(size, std::move(result)); |
| 550 | } |
| 551 | }; |
| 552 | Data::LoadCloudFile( |
| 553 | &session(), |
| 554 | videoFile(size), |
| 555 | origin, |
| 556 | LoadFromCloudOrLocal, |
| 557 | autoLoading, |
| 558 | Data::kAnimationCacheTag, |
| 559 | finalCheck, |
| 560 | done); |
| 561 | } |
| 562 | |
| 563 | const ImageLocation &PhotoData::videoLocation(Data::PhotoSize size) const { |
| 564 | static const auto empty = ImageLocation(); |
no test coverage detected