public virtual async Task<UploadSession> UpdateSessionStatusAsync()
{
var request = new UploadSessionRequest(this.Session, this.client, null);
var newSession = await request.GetAsync();
var newRangesRemaining = this.GetRangesRemaining(newSession);
this.rangesRemaining = newRangesRemaining;
newSession.UploadUrl = this.Session.UploadUrl; // Sometimes the UploadUrl is not returned
this.Session = newSession;
return newSession;
}
/// <inheritdoc/> public async Task <long> GetUploadStatusAsync() { if (_uploadProvider != null && IsUploadCompleted == false) { if (Provider.AuthenticationProvider is MsaAuthenticationProvider) { var remainingRequests = _uploadProvider.GetUploadChunkRequests(); var firstChunck = remainingRequests.First <OneDriveSdk.UploadChunkRequest>(); var status = await _uploadProvider.UpdateSessionStatusAsync(); return(firstChunck.RangeBegin); } } // no more data return(0); }