mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
CD parity information database
This commit is contained in:
@@ -581,9 +581,9 @@ namespace CUETools.AccurateRip
|
||||
if (conf > 0)
|
||||
sw.WriteLine(String.Format(" {0:00}\t[{1:x8}] ({3:00}/{2:00}) Accurately ripped", iTrack + 1, CRC(iTrack, oi), count, conf));
|
||||
else if (partials > 0)
|
||||
sw.WriteLine(String.Format(" {0:00}\t[{1:x8}] ({3:00}/{2:00}) Partial match", iTrack + 1, CRC(iTrack, oi), count, partials));
|
||||
sw.WriteLine(String.Format(" {0:00}\t[{1:x8}] ({3:00}/{2:00}) No match but offset", iTrack + 1, CRC(iTrack, oi), count, partials));
|
||||
else
|
||||
sw.WriteLine(String.Format(" {0:00}\t[{1:x8}] (00/{2:00}) No matches", iTrack + 1, CRC(iTrack, oi), count));
|
||||
sw.WriteLine(String.Format(" {0:00}\t[{1:x8}] (00/{2:00}) No match", iTrack + 1, CRC(iTrack, oi), count));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace CUETools.CTDB
|
||||
public class CUEToolsDB
|
||||
{
|
||||
const string urlbase = "http://db.cuetools.net";
|
||||
const string userAgent = "CUETools 205";
|
||||
|
||||
private CDRepairEncode verify;
|
||||
private CDImageLayout toc;
|
||||
@@ -66,6 +67,7 @@ namespace CUETools.CTDB
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Method = "GET";
|
||||
req.Proxy = proxy;
|
||||
req.UserAgent = userAgent;
|
||||
contents = null;
|
||||
total = 0;
|
||||
|
||||
@@ -124,7 +126,7 @@ namespace CUETools.CTDB
|
||||
return cpuInfo ?? "unknown";
|
||||
}
|
||||
|
||||
public string Submit(int confidence, int total)
|
||||
public string Submit(int confidence, int total, string artist, string title)
|
||||
{
|
||||
if (fullid == null)
|
||||
throw new Exception("no id");
|
||||
@@ -157,8 +159,11 @@ namespace CUETools.CTDB
|
||||
TRAK.Write(toc[i].Length);
|
||||
}
|
||||
}
|
||||
if (artist != null && artist != "") using (DBHDR TAG = DISC.HDR("ART ")) TAG.Write(artist);
|
||||
if (title != null && title != "") using (DBHDR TAG = DISC.HDR("nam ")) TAG.Write(title);
|
||||
using (DBHDR USER = DISC.HDR("USER")) USER.Write(GetCPUID());
|
||||
using (DBHDR TOOL = DISC.HDR("TOOL")) TOOL.Write("CUETools 205");
|
||||
using (DBHDR TOOL = DISC.HDR("MBID")) TOOL.Write(toc.MusicBrainzId);
|
||||
using (DBHDR DATE = DISC.HDR("DATE")) DATE.Write(DateTime.Now);
|
||||
using (DBHDR CONF = DISC.HDR("CONF")) CONF.Write(confidence);
|
||||
using (DBHDR NPAR = DISC.HDR("NPAR")) NPAR.Write(verify.NPAR);
|
||||
@@ -168,9 +173,9 @@ namespace CUETools.CTDB
|
||||
}
|
||||
newcontents.Position = 0;
|
||||
files[0] = new UploadFile(newcontents, "uploadedfile", "data.bin", "image/binary");
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(urlbase + "/uploader2.php");
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(urlbase + "/submit.php");
|
||||
req.Proxy = proxy;
|
||||
req.UserAgent = "CUETools 205";
|
||||
req.UserAgent = userAgent;
|
||||
NameValueCollection form = new NameValueCollection();
|
||||
form.Add("id", fullid);
|
||||
HttpWebResponse resp = uploadHelper.Upload(req, files, form);
|
||||
@@ -204,7 +209,7 @@ namespace CUETools.CTDB
|
||||
total = rdr.ReadInt();
|
||||
rdr.pos = end;
|
||||
}
|
||||
rdr.pos = end;
|
||||
rdr.pos = endHead;
|
||||
while (rdr.pos < contents.Length)
|
||||
{
|
||||
hdr = rdr.ReadHDR(out end);
|
||||
@@ -293,6 +298,14 @@ namespace CUETools.CTDB
|
||||
}
|
||||
}
|
||||
|
||||
public string SubStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return subResult;
|
||||
}
|
||||
}
|
||||
|
||||
public string DBStatus
|
||||
{
|
||||
get
|
||||
|
||||
@@ -3544,7 +3544,26 @@ string status = processor.Go();
|
||||
if (_useCUEToolsDBFix)// && _CUEToolsDB.SelectedEntry != null)
|
||||
sw.WriteLine("CUETools DB: corrected {0} errors.", _CUEToolsDB.SelectedEntry.repair.CorrectableErrors);
|
||||
else if (_useCUEToolsDB)
|
||||
sw.WriteLine("CUETools DB: {0}.", _CUEToolsDB.Status);
|
||||
{
|
||||
if (_CUEToolsDB.DBStatus != null)
|
||||
sw.WriteLine("CUETools DB: {0}.", _CUEToolsDB.DBStatus);
|
||||
if (_CUEToolsDB.SubStatus != null)
|
||||
sw.WriteLine("CUETools DB: {0}.", _CUEToolsDB.SubStatus);
|
||||
if (_CUEToolsDB.DBStatus == null)
|
||||
sw.WriteLine(" [ CTDBID ] Status");
|
||||
foreach (DBEntry entry in _CUEToolsDB.Entries)
|
||||
{
|
||||
string confFormat = (_CUEToolsDB.Total < 10) ? "{0:0}/{1:0}" :
|
||||
(_CUEToolsDB.Total < 100) ? "{0:00}/{1:00}" : "{0:000}/{1:000}";
|
||||
string conf = string.Format(confFormat, entry.conf, _CUEToolsDB.Total);
|
||||
string status =
|
||||
(!entry.hasErrors) ? "Accurately ripped" :
|
||||
entry.canRecover ? string.Format("Contains {0} correctable errors", entry.repair.CorrectableErrors) :
|
||||
(entry.httpStatus == 0 || entry.httpStatus == HttpStatusCode.OK) ? "No match" :
|
||||
entry.httpStatus.ToString();
|
||||
sw.WriteLine(" [{0:x8}] ({1}) {2}", entry.crc, conf, status);
|
||||
}
|
||||
}
|
||||
_arVerify.GenerateFullLog(sw, _config.arLogVerbose);
|
||||
}
|
||||
|
||||
@@ -3681,10 +3700,10 @@ string status = processor.Go();
|
||||
if (_audioEncoderType != AudioEncoderType.NoAudio || _action == CUEAction.Verify)
|
||||
WriteAudioFilesPass(OutputDir, OutputStyle, destLengths, htoaToFile, _action == CUEAction.Verify);
|
||||
|
||||
if (_useCUEToolsDB && CTDB.AccResult == HttpStatusCode.OK)
|
||||
if (_useCUEToolsDB && _CUEToolsDB.AccResult == HttpStatusCode.OK)
|
||||
{
|
||||
if (!_useCUEToolsDBFix)
|
||||
CTDB.DoVerify();
|
||||
_CUEToolsDB.DoVerify();
|
||||
}
|
||||
|
||||
_processed = true;
|
||||
@@ -5217,7 +5236,7 @@ string status = processor.Go();
|
||||
return "CUEToolsDB: " + CTDB.Status;
|
||||
if (ArVerify.WorstConfidence() < 3)
|
||||
return status + ": confidence too low";
|
||||
return CTDB.Submit((int)ArVerify.WorstConfidence(), (int)ArVerify.WorstTotal());
|
||||
return CTDB.Submit((int)ArVerify.WorstConfidence(), (int)ArVerify.WorstTotal(), Artist, Title);
|
||||
}
|
||||
case "repair":
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user