parent
71bdfb862f
commit
995671e0eb
|
|
@ -175,11 +175,12 @@ public class MinioDownloadTask : NotifyPropertyChangedBase
|
|||
? $"{TotalSize / 1048576}MB"
|
||||
: $"{TotalSize / 1024}KB");
|
||||
var offset = Downloaded;
|
||||
Console.WriteLine("偏移量:" + (offset > 1048576 ? $"{offset / 1048576:f2}MB" : $"{(offset) / 1024:f2}KB"));
|
||||
await Minio.DownLoadObjectWithCallBack(this, Bucket, ObjectKey, FilePath, FileETag,
|
||||
(downloaded, total, speed) =>
|
||||
{
|
||||
var progress = (double)(downloaded + offset) / total * 100;
|
||||
Downloaded = downloaded;
|
||||
Downloaded = downloaded + offset;
|
||||
/*using (var client = SqlSugarConfig.GetSqlSugarScope())
|
||||
{
|
||||
updateTask.Downloaded = downloaded;
|
||||
|
|
|
|||
|
|
@ -460,15 +460,14 @@ namespace Hopetry.Services
|
|||
if (token.IsCancellationRequested)
|
||||
{
|
||||
//保存下载进度
|
||||
var client = SqlSugarConfig.GetSqlSugarScope();
|
||||
using var client = SqlSugarConfig.GetSqlSugarScope();
|
||||
var temp = new MinioDownloadTask
|
||||
{
|
||||
TaskId = downTask.TaskId,
|
||||
Downloaded = bytesRead
|
||||
Downloaded = bytesRead + offset
|
||||
};
|
||||
client.Updateable(temp).IgnoreNullColumns().ExecuteCommand();
|
||||
client.Close();
|
||||
downTask.Downloaded = bytesRead;
|
||||
downTask.Downloaded = temp.Downloaded;
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,6 +196,8 @@ public class DownViewModel : MvcViewModelBase
|
|||
else if (item.Status == "已暂停")
|
||||
{
|
||||
item.Status = "等待中";
|
||||
// 更新排队时,下载信息
|
||||
item.Speed = "等待中";
|
||||
item.StartOrPauseIcon = "\xe76e";
|
||||
// 加入下载等待队列
|
||||
_taskQueue.Enqueue(item);
|
||||
|
|
|
|||
Loading…
Reference in New Issue