2011-10-24 14:32:51 +00:00
|
|
|
|
using System.Net;
|
|
|
|
|
|
using CUETools.AccurateRip;
|
|
|
|
|
|
using CUETools.CDImage;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.CTDB
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DBEntry
|
|
|
|
|
|
{
|
2011-10-27 20:50:11 +00:00
|
|
|
|
public ushort[,] syndrome;
|
2011-10-24 14:32:51 +00:00
|
|
|
|
public int conf;
|
|
|
|
|
|
public int stride;
|
|
|
|
|
|
public int offset;
|
|
|
|
|
|
public uint crc;
|
|
|
|
|
|
public bool hasErrors;
|
|
|
|
|
|
public bool canRecover;
|
|
|
|
|
|
public CDRepairFix repair;
|
|
|
|
|
|
public HttpStatusCode httpStatus;
|
|
|
|
|
|
public string id;
|
|
|
|
|
|
public CDImageLayout toc;
|
|
|
|
|
|
public string hasParity;
|
|
|
|
|
|
|
2011-10-27 20:50:11 +00:00
|
|
|
|
public DBEntry(ushort[,] syndrome, int conf, int stride, uint crc, string id, CDImageLayout toc, string hasParity)
|
2011-10-24 14:32:51 +00:00
|
|
|
|
{
|
2011-10-27 20:50:11 +00:00
|
|
|
|
this.syndrome = syndrome;
|
2011-10-24 14:32:51 +00:00
|
|
|
|
this.id = id;
|
|
|
|
|
|
this.conf = conf;
|
|
|
|
|
|
this.crc = crc;
|
|
|
|
|
|
this.stride = stride;
|
|
|
|
|
|
this.toc = toc;
|
|
|
|
|
|
this.hasParity = hasParity;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-10-27 20:50:11 +00:00
|
|
|
|
public int Npar
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return syndrome.GetLength(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-10-24 14:32:51 +00:00
|
|
|
|
public string Status
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!hasErrors)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Format("verified OK, confidence {0}", conf);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (canRecover)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Format("differs in {1} samples, confidence {0}", conf, repair.CorrectableErrors);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (httpStatus == HttpStatusCode.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "could not be verified";
|
|
|
|
|
|
}
|
|
|
|
|
|
return "could not be verified: " + httpStatus.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|