Download rework (#36)

* handle download ready from signalr

* add cancellation to the server

* adjust queue for removal and cancellation

* adjust api to main

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
rootdarkarchon
2023-01-15 16:00:10 +01:00
committed by GitHub
parent f5f9b9c6fc
commit 5a16a15e8b
6 changed files with 74 additions and 72 deletions

View File

@@ -84,6 +84,12 @@ public partial class ApiController
_mareHub!.On(nameof(Client_ReceiveServerMessage), act);
}
public void OnDownloadReady(Action<Guid> act)
{
if (_initialized) return;
_mareHub!.On(nameof(Client_DownloadReady), act);
}
public Task Client_UserUpdateClientPairs(ClientPairDto dto)
{
var entry = PairedClients.SingleOrDefault(e => string.Equals(e.OtherUID, dto.OtherUID, System.StringComparison.Ordinal));
@@ -243,4 +249,11 @@ public partial class ApiController
return Task.CompletedTask;
}
public Task Client_DownloadReady(Guid requestId)
{
Logger.Debug($"Server sent {requestId} ready");
_downloadReady[requestId] = true;
return Task.CompletedTask;
}
}