| 681 | } |
| 682 | |
| 683 | void GetAudioInfo( |
| 684 | OAuthService& oAuthService, const ServiceConfig& serviceConfig, |
| 685 | std::string audioId, |
| 686 | std::function<void(sync::CloudAudioFullInfo, ResponseResult)> callback) |
| 687 | { |
| 688 | assert(callback); |
| 689 | |
| 690 | PerformProjectGetRequest( |
| 691 | oAuthService, serviceConfig.GetAudioInfoUrl(audioId), |
| 692 | [callback = std::move(callback)](ResponseResult result) |
| 693 | { |
| 694 | if (result.Code != SyncResultCode::Success) |
| 695 | { |
| 696 | callback(sync::CloudAudioFullInfo {}, std::move(result)); |
| 697 | return; |
| 698 | } |
| 699 | |
| 700 | auto audioInfo = sync::DeserializeCloudAudioFullInfo(result.Content); |
| 701 | |
| 702 | if (!audioInfo) |
| 703 | { |
| 704 | callback({}, { SyncResultCode::UnexpectedResponse, |
| 705 | std::move(result.Content) }); |
| 706 | return; |
| 707 | } |
| 708 | |
| 709 | callback(std::move(*audioInfo), std::move(result)); |
| 710 | }); |
| 711 | } |
| 712 | |
| 713 | void GetAudioDownloadInfo( |
| 714 | OAuthService& oAuthService, const ServiceConfig& serviceConfig, |
no test coverage detected