| 711 | } |
| 712 | |
| 713 | void GetAudioDownloadInfo( |
| 714 | OAuthService& oAuthService, const ServiceConfig& serviceConfig, |
| 715 | std::string audioId, |
| 716 | std::function<void(sync::CloudAudioDownloadInfo, ResponseResult)> callback) |
| 717 | { |
| 718 | assert(callback); |
| 719 | |
| 720 | PerformProjectGetRequest(oAuthService, serviceConfig.GetAudioDownloadListUrl(audioId), |
| 721 | [callback = std::move(callback)](ResponseResult result) |
| 722 | { |
| 723 | if (result.Code != SyncResultCode::Success) |
| 724 | { |
| 725 | callback(sync::CloudAudioDownloadInfo {}, std::move(result)); |
| 726 | return; |
| 727 | } |
| 728 | |
| 729 | auto downloadInfo = sync::DeserializeCloudAudioDownloadInfo(result.Content); |
| 730 | |
| 731 | if (!downloadInfo) |
| 732 | { |
| 733 | callback({}, { |
| 734 | SyncResultCode::UnexpectedResponse, |
| 735 | std::move(result.Content) }); |
| 736 | return; |
| 737 | } |
| 738 | |
| 739 | callback(std::move(*downloadInfo), std::move(result)); |
| 740 | }); |
| 741 | } |
| 742 | |
| 743 | CloudSyncService::GetAudioInfoFuture GetAudioInfo( |
| 744 | concurrency::CancellationContextPtr context, std::string_view audioId) { |
no test coverage detected