wabbajack/Wabbajack.Server/DTOs/MirroredFile.cs

31 lines
793 B
C#
Raw Normal View History

2020-08-04 03:05:19 +00:00
using System;
using System.Threading.Tasks;
2020-08-04 03:05:19 +00:00
using Wabbajack.Common;
using Wabbajack.Server.DataLayer;
2020-08-04 03:05:19 +00:00
namespace Wabbajack.Server.DTOs
{
public class MirroredFile
{
public Hash Hash { get; set; }
public DateTime Created { get; set; }
public DateTime? Uploaded { get; set; }
public string Rationale { get; set; }
public string FailMessage { get; set; }
public async Task Finish(SqlService sql)
{
Uploaded = DateTime.UtcNow;
await sql.UpsertMirroredFile(this);
}
public async Task Fail(SqlService sql, string message)
{
Uploaded = DateTime.UtcNow;
FailMessage = message;
await sql.UpsertMirroredFile(this);
}
2020-08-04 03:05:19 +00:00
}
}