From 5ab92a703fe01634e086cbf278dc8ca36c438a54 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Wed, 27 Aug 2025 21:02:59 -0400 Subject: Add auto downloading of project file dependencies, clean up download APIs --- collaboration.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'collaboration.cpp') diff --git a/collaboration.cpp b/collaboration.cpp index d7d5d6e2..b0cb5421 100644 --- a/collaboration.cpp +++ b/collaboration.cpp @@ -1853,14 +1853,23 @@ void RemoteFile::DeleteSnapshot(const Ref snapshot) } -std::vector RemoteFile::Download(ProgressFunction progress) +void RemoteFile::Download(ProgressFunction progress) +{ + ProgressContext pctxt; + pctxt.callback = progress; + if (!BNRemoteFileDownload(m_object, ProgressCallback, &pctxt)) + throw RemoteException("Failed to download file"); +} + + +std::vector RemoteFile::DownloadContents(ProgressFunction progress) { ProgressContext pctxt; pctxt.callback = progress; size_t size = 0; uint8_t* data; - if (!BNRemoteFileDownload(m_object, ProgressCallback, &pctxt, &data, &size)) - throw SyncException("Failed to download file"); + if (!BNRemoteFileDownloadContents(m_object, ProgressCallback, &pctxt, &data, &size)) + throw SyncException("Failed to download file contents"); std::vector out; out.insert(out.end(), &data[0], &data[size]); -- cgit v1.3.1