MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / exportProfileMusic

Method exportProfileMusic

Telegram/SourceFiles/export/export_controller.cpp:522–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522void ControllerObject::exportProfileMusic() {
523 _api.requestProfileMusic([=](Data::ProfileMusicInfo &&start) {
524 if (ioCatchError(_writer->writeProfileMusicStart(start))) {
525 return false;
526 }
527 _profileMusicWritten = 0;
528 _profileMusicCount = start.count;
529 return true;
530 }, [=](DownloadProgress progress) {
531 setState(stateProfileMusic(progress));
532 return true;
533 }, [=](Data::ProfileMusicSlice &&slice) {
534 if (ioCatchError(_writer->writeProfileMusicSlice(slice))) {
535 return false;
536 }
537 _profileMusicWritten += slice.list.size();
538 setState(stateProfileMusic(DownloadProgress()));
539 return true;
540 }, [=] {
541 if (ioCatchError(_writer->writeProfileMusicEnd())) {
542 return;
543 }
544 exportNext();
545 });
546}
547
548void ControllerObject::exportContacts() {
549 setState(stateContacts());

Callers

nothing calls this directly

Calls 6

requestProfileMusicMethod · 0.80
DownloadProgressClass · 0.70
sizeMethod · 0.45
writeProfileMusicEndMethod · 0.45

Tested by

no test coverage detected