| 468 | } |
| 469 | |
| 470 | void ControllerObject::exportUserpics() { |
| 471 | _api.requestUserpics([=](Data::UserpicsInfo &&start) { |
| 472 | if (ioCatchError(_writer->writeUserpicsStart(start))) { |
| 473 | return false; |
| 474 | } |
| 475 | _userpicsWritten = 0; |
| 476 | _userpicsCount = start.count; |
| 477 | return true; |
| 478 | }, [=](DownloadProgress progress) { |
| 479 | setState(stateUserpics(progress)); |
| 480 | return true; |
| 481 | }, [=](Data::UserpicsSlice &&slice) { |
| 482 | if (ioCatchError(_writer->writeUserpicsSlice(slice))) { |
| 483 | return false; |
| 484 | } |
| 485 | _userpicsWritten += slice.list.size(); |
| 486 | setState(stateUserpics(DownloadProgress())); |
| 487 | return true; |
| 488 | }, [=] { |
| 489 | if (ioCatchError(_writer->writeUserpicsEnd())) { |
| 490 | return; |
| 491 | } |
| 492 | exportNext(); |
| 493 | }); |
| 494 | } |
| 495 | |
| 496 | void ControllerObject::exportStories() { |
| 497 | _api.requestStories([=](Data::StoriesInfo &&start) { |
nothing calls this directly
no test coverage detected