MCPcopy Create free account
hub / github.com/audacity/audacity / GetAudioDownloadInfo

Function GetAudioDownloadInfo

libraries/lib-cloud-audiocom/CloudSyncService.cpp:713–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713void 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
743CloudSyncService::GetAudioInfoFuture GetAudioInfo(
744 concurrency::CancellationContextPtr context, std::string_view audioId) {

Callers 1

DownloadCloudAudioMethod · 0.85

Calls 5

PerformProjectGetRequestFunction · 0.85
moveFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected