mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
EAC CTDB plugin update for new EAC version
This commit is contained in:
@@ -58,7 +58,7 @@ namespace CUETools.CTDB.EACPlugin
|
||||
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
#if DEBUG
|
||||
string server = "hq.cuetools.net";
|
||||
string server = "db.cuetools.net";
|
||||
#else
|
||||
string server = null;
|
||||
#endif
|
||||
@@ -239,12 +239,13 @@ namespace CUETools.CTDB.EACPlugin
|
||||
var discnumber01 = (uint.TryParse(disccount, out td) && uint.TryParse(discnumber, out dn) && td > 9 && dn > 0) ?
|
||||
string.Format("{0:00}", dn) : discnumber;
|
||||
var discnumberandtotal = disccount != "1" ? discnumber01 + "/" + disccount : (discnumber != "1" ? discnumber01 : "");
|
||||
var label = metadata.country ?? "";
|
||||
var label = "";
|
||||
if (metadata.release != null)
|
||||
foreach (var r in metadata.release)
|
||||
label = (label == "" ? "" : label + ": ") + (r.country ?? "") + (r.country != null && r.date != null ? " " : "") + (r.date ?? "");
|
||||
if (metadata.label != null)
|
||||
foreach (var l in metadata.label)
|
||||
label = (label == "" ? "" : label + ": ") + (l.name ?? "") + (l.name != null && l.catno != null ? " " : "") + (l.catno ?? "");
|
||||
if (metadata.releasedate != null)
|
||||
label = (label == "" ? "" : label + ": ") + metadata.releasedate;
|
||||
var text = string.Format("{0}{1} - {2}{3}{4}", metadata.year != null ? metadata.year + ": " : "",
|
||||
metadata.artist == null ? "Unknown Artist" : metadata.artist,
|
||||
metadata.album == "" ? "Unknown Title" : metadata.album,
|
||||
|
||||
Binary file not shown.
@@ -62,10 +62,14 @@ namespace MetadataPlugIn
|
||||
extra += "Info URL: " + meta.infourl + "\r\n";
|
||||
if (!string.IsNullOrEmpty(meta.barcode))
|
||||
extra += "Barcode: " + meta.barcode + "\r\n";
|
||||
if (!string.IsNullOrEmpty(meta.releasedate))
|
||||
extra += "Release date: " + meta.releasedate + "\r\n";
|
||||
if (!string.IsNullOrEmpty(meta.country))
|
||||
extra += "Release country: " + meta.country + "\r\n";
|
||||
if (meta.release != null)
|
||||
foreach (var release in meta.release)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(release.date))
|
||||
extra += "Release date: " + release.date + "\r\n";
|
||||
if (!string.IsNullOrEmpty(release.country))
|
||||
extra += "Release country: " + release.country + "\r\n";
|
||||
}
|
||||
if (meta.label != null)
|
||||
foreach (var label in meta.label)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace AudioDataPlugIn
|
||||
public class AudioDataTransfer : IAudioDataTransfer
|
||||
{
|
||||
int m_start_pos = 0, m_length = 0;
|
||||
int m_suspicious = 0;
|
||||
int m_suspiciousTest = 0;
|
||||
bool m_test_mode = false;
|
||||
IMetadataLookup m_data = null;
|
||||
CDImageLayout TOC;
|
||||
@@ -72,6 +74,17 @@ namespace AudioDataPlugIn
|
||||
}
|
||||
|
||||
|
||||
public void SuspiciousPosition()
|
||||
{
|
||||
if (this.m_test_mode)
|
||||
this.m_suspiciousTest++;
|
||||
else
|
||||
this.m_suspicious++;
|
||||
#if DEBUG
|
||||
var thisAr = m_test_mode ? arTest : ar;
|
||||
m_trace.WriteLine("Suspicious position: {0} ({1}*588)", thisAr.Position, thisAr.Position/588);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Now to the audio transfer functions, the sequence how
|
||||
// the functions are called is:
|
||||
@@ -133,6 +146,8 @@ namespace AudioDataPlugIn
|
||||
this.sequence_ok = true;
|
||||
this.m_start_pos = 0;
|
||||
this.m_length = 0;
|
||||
this.m_suspicious = 0;
|
||||
this.m_suspiciousTest = 0;
|
||||
this.m_test_mode = false;
|
||||
this.is_offset_set = aroffset;
|
||||
this.is_secure_mode = mode >= 2;
|
||||
@@ -266,7 +281,10 @@ namespace AudioDataPlugIn
|
||||
"EAC" + m_data.HostVersion + " CTDB 2.1.6",
|
||||
m_drivename,
|
||||
conf,
|
||||
(arTest.Position == 0 && this.is_secure_mode) || (arTest.Position != 0 && arTest.CRC32(0) == ar.CRC32(0)) ? 100 : 0,
|
||||
(arTest.Position != 0 && arTest.CRC32(0) == ar.CRC32(0)) ? 100 :
|
||||
(arTest.Position == 0 && this.is_secure_mode) ?
|
||||
(int)(100 * (1.0 - Math.Log(m_suspicious + 1) / Math.Log(TOC.AudioLength + 1))) :
|
||||
(int)( 49 * (1.0 - Math.Log(m_suspicious + 1) / Math.Log(TOC.AudioLength + 1))),
|
||||
m_data.AlbumArtist,
|
||||
m_data.AlbumTitle);
|
||||
form.ShowDialog();
|
||||
|
||||
@@ -19,8 +19,6 @@ namespace CUETools.CTDB
|
||||
this.year = src.year;
|
||||
this.genre = src.genre;
|
||||
this.extra = src.extra;
|
||||
this.country = src.country;
|
||||
this.releasedate = src.releasedate;
|
||||
this.discnumber = src.discnumber;
|
||||
this.disccount = src.disccount;
|
||||
this.discname = src.discname;
|
||||
@@ -46,6 +44,13 @@ namespace CUETools.CTDB
|
||||
for (int i = 0; i < src.label.Length; i++)
|
||||
this.label[i] = new CTDBResponseMetaLabel(src.label[i]);
|
||||
}
|
||||
|
||||
if (src.release != null)
|
||||
{
|
||||
this.release = new CTDBResponseMetaRelease[src.release.Length];
|
||||
for (int i = 0; i < src.release.Length; i++)
|
||||
this.release[i] = new CTDBResponseMetaRelease(src.release[i]);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
@@ -63,10 +68,6 @@ namespace CUETools.CTDB
|
||||
[XmlElement]
|
||||
public string extra { get; set; }
|
||||
[XmlAttribute]
|
||||
public string country { get; set; }
|
||||
[XmlAttribute]
|
||||
public string releasedate { get; set; }
|
||||
[XmlAttribute]
|
||||
public string discnumber { get; set; }
|
||||
[XmlAttribute]
|
||||
public string disccount { get; set; }
|
||||
@@ -82,5 +83,7 @@ namespace CUETools.CTDB
|
||||
public CTDBResponseMetaTrack[] track;
|
||||
[XmlElement]
|
||||
public CTDBResponseMetaLabel[] label;
|
||||
[XmlElement]
|
||||
public CTDBResponseMetaRelease[] release;
|
||||
}
|
||||
}
|
||||
|
||||
24
CUETools.CTDB/CTDBResponseMetaRelease.cs
Normal file
24
CUETools.CTDB/CTDBResponseMetaRelease.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CUETools.CTDB
|
||||
{
|
||||
[Serializable]
|
||||
public class CTDBResponseMetaRelease
|
||||
{
|
||||
public CTDBResponseMetaRelease()
|
||||
{
|
||||
}
|
||||
|
||||
public CTDBResponseMetaRelease(CTDBResponseMetaRelease src)
|
||||
{
|
||||
this.date = src.date;
|
||||
this.country = src.country;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string date { get; set; }
|
||||
[XmlAttribute]
|
||||
public string country { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CTDBResponseMetaRelease.cs" />
|
||||
<Compile Include="CTDBResponseMetaImage.cs" />
|
||||
<Compile Include="CTDBMetadataSearch.cs" />
|
||||
<Compile Include="CTDBResponse.cs" />
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace CUETools.CTDB
|
||||
|
||||
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(urlbase
|
||||
+ "/lookup2.php"
|
||||
+ "?version=2"
|
||||
+ "?version=3"
|
||||
+ "&ctdb=" + (ctdb ? 1 : 0)
|
||||
+ "&fuzzy=" + (fuzzy ? 1 : 0)
|
||||
+ "&metadata=" + (metadataSearch == CTDBMetadataSearch.None ? "none" : metadataSearch == CTDBMetadataSearch.Fast ? "fast" : metadataSearch == CTDBMetadataSearch.Default ? "default" : "extensive")
|
||||
|
||||
Reference in New Issue
Block a user