mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
32 lines
876 B
C#
32 lines
876 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Wabbajack.Lib;
|
|
using Wabbajack.Server.DataLayer;
|
|
|
|
namespace Wabbajack.Server.DTOs
|
|
{
|
|
public class ArchiveDownload
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Archive Archive { get; set; }
|
|
public bool? IsFailed { get; set; }
|
|
public DateTime? DownloadFinished { get; set; }
|
|
public string FailMessage { get; set; }
|
|
|
|
public async Task Fail(SqlService service, string message)
|
|
{
|
|
IsFailed = true;
|
|
DownloadFinished = DateTime.UtcNow;
|
|
FailMessage = message;
|
|
await service.UpdatePendingDownload(this);
|
|
}
|
|
|
|
public async Task Finish(SqlService service)
|
|
{
|
|
IsFailed = false;
|
|
DownloadFinished = DateTime.UtcNow;
|
|
await service.UpdatePendingDownload(this);
|
|
}
|
|
}
|
|
}
|