mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move GetDuplicateSuffix to where it's used
This commit is contained in:
@@ -1988,176 +1988,5 @@ namespace SabreTools.Core.Test
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetDuplicateSuffix
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_NoHash_Generic()
|
|
||||||
{
|
|
||||||
DictionaryBase self = new Disk();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Disk { [Disk.MD5Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Disk { [Disk.SHA1Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Media_NoHash_Generic()
|
|
||||||
{
|
|
||||||
DictionaryBase self = new Media();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Media_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Media { [Media.MD5Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Media_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Media { [Media.SHA1Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Media_SHA256()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Media { [Media.SHA256Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Media_SpamSum()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Media { [Media.SpamSumKey] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_NoHash_Generic()
|
|
||||||
{
|
|
||||||
DictionaryBase self = new Rom();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_CRC()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.CRCKey] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_MD2()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.MD2Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_MD4()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.MD4Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.MD5Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.SHA1Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_SHA256()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.SHA256Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_SHA384()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.SHA384Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_SHA512()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.SHA512Key] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Rom_SpamSum()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
DictionaryBase self = new Rom { [Rom.SpamSumKey] = hash };
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Other_Generic()
|
|
||||||
{
|
|
||||||
DictionaryBase self = new Sample();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -929,110 +929,5 @@ namespace SabreTools.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Suffix Generation
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
public static string GetDuplicateSuffix(this DictionaryBase? self)
|
|
||||||
{
|
|
||||||
if (self == null)
|
|
||||||
return string.Empty;
|
|
||||||
|
|
||||||
return self switch
|
|
||||||
{
|
|
||||||
Disk diskSelf => diskSelf.GetDuplicateSuffix(),
|
|
||||||
Media mediaSelf => mediaSelf.GetDuplicateSuffix(),
|
|
||||||
Rom romSelf => romSelf.GetDuplicateSuffix(),
|
|
||||||
_ => "_1",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
private static string GetDuplicateSuffix(this Disk self)
|
|
||||||
{
|
|
||||||
string? md5 = self.ReadString(Disk.MD5Key);
|
|
||||||
if (!string.IsNullOrEmpty(md5))
|
|
||||||
return $"_{md5}";
|
|
||||||
|
|
||||||
string? sha1 = self.ReadString(Disk.SHA1Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha1))
|
|
||||||
return $"_{sha1}";
|
|
||||||
|
|
||||||
return "_1";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
private static string GetDuplicateSuffix(this Media self)
|
|
||||||
{
|
|
||||||
string? md5 = self.ReadString(Media.MD5Key);
|
|
||||||
if (!string.IsNullOrEmpty(md5))
|
|
||||||
return $"_{md5}";
|
|
||||||
|
|
||||||
string? sha1 = self.ReadString(Media.SHA1Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha1))
|
|
||||||
return $"_{sha1}";
|
|
||||||
|
|
||||||
string? sha256 = self.ReadString(Media.SHA256Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha256))
|
|
||||||
return $"_{sha256}";
|
|
||||||
|
|
||||||
string? spamSum = self.ReadString(Media.SpamSumKey);
|
|
||||||
if (!string.IsNullOrEmpty(spamSum))
|
|
||||||
return $"_{spamSum}";
|
|
||||||
|
|
||||||
return "_1";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
private static string GetDuplicateSuffix(this Rom self)
|
|
||||||
{
|
|
||||||
string? crc = self.ReadString(Rom.CRCKey);
|
|
||||||
if (!string.IsNullOrEmpty(crc))
|
|
||||||
return $"_{crc}";
|
|
||||||
|
|
||||||
string? md2 = self.ReadString(Rom.MD2Key);
|
|
||||||
if (!string.IsNullOrEmpty(md2))
|
|
||||||
return $"_{md2}";
|
|
||||||
|
|
||||||
string? md4 = self.ReadString(Rom.MD4Key);
|
|
||||||
if (!string.IsNullOrEmpty(md4))
|
|
||||||
return $"_{md4}";
|
|
||||||
|
|
||||||
string? md5 = self.ReadString(Rom.MD5Key);
|
|
||||||
if (!string.IsNullOrEmpty(md5))
|
|
||||||
return $"_{md5}";
|
|
||||||
|
|
||||||
string? sha1 = self.ReadString(Rom.SHA1Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha1))
|
|
||||||
return $"_{sha1}";
|
|
||||||
|
|
||||||
string? sha256 = self.ReadString(Rom.SHA256Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha256))
|
|
||||||
return $"_{sha256}";
|
|
||||||
|
|
||||||
string? sha384 = self.ReadString(Rom.SHA384Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha384))
|
|
||||||
return $"_{sha384}";
|
|
||||||
|
|
||||||
string? sha512 = self.ReadString(Rom.SHA512Key);
|
|
||||||
if (!string.IsNullOrEmpty(sha512))
|
|
||||||
return $"_{sha512}";
|
|
||||||
|
|
||||||
string? spamSum = self.ReadString(Rom.SpamSumKey);
|
|
||||||
if (!string.IsNullOrEmpty(spamSum))
|
|
||||||
return $"_{spamSum}";
|
|
||||||
|
|
||||||
return "_1";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1616,6 +1616,255 @@ namespace SabreTools.DatFiles.Test
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region GetDuplicateSuffix
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Disk_NoHash_Generic()
|
||||||
|
{
|
||||||
|
DatItem datItem = new Disk();
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal("_1", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Disk_MD5()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Disk();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Disk.MD5Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Disk_SHA1()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Disk();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Disk.SHA1Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_File_NoHash_Generic()
|
||||||
|
{
|
||||||
|
DatItem datItem = new DatItems.Formats.File();
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal("_1", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_File_CRC()
|
||||||
|
{
|
||||||
|
string hash = "deadbeef";
|
||||||
|
DatItems.Formats.File datItem = new DatItems.Formats.File { CRC = hash };
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_File_MD5()
|
||||||
|
{
|
||||||
|
string hash = "000000000000000000000000deadbeef";
|
||||||
|
DatItem datItem = new DatItems.Formats.File { MD5 = hash };
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_File_SHA1()
|
||||||
|
{
|
||||||
|
string hash = "00000000000000000000000000000000deadbeef";
|
||||||
|
DatItem datItem = new DatItems.Formats.File { SHA1 = hash };
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_File_SHA256()
|
||||||
|
{
|
||||||
|
string hash = "00000000000000000000000000000000000000000000000000000000deadbeef";
|
||||||
|
DatItem datItem = new DatItems.Formats.File { SHA256 = hash };
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Media_NoHash_Generic()
|
||||||
|
{
|
||||||
|
DatItem datItem = new Media();
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal("_1", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Media_MD5()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Media();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Media.MD5Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Media_SHA1()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Media();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Media.SHA1Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Media_SHA256()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Media();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Media.SHA256Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Media_SpamSum()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Media();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Media.SpamSumKey, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_NoHash_Generic()
|
||||||
|
{
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal("_1", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_CRC()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.CRCKey, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_MD2()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.MD2Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_MD4()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.MD4Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_MD5()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.MD5Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_SHA1()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.SHA1Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_SHA256()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.SHA256Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_SHA384()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.SHA384Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_SHA512()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.SHA512Key, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Rom_SpamSum()
|
||||||
|
{
|
||||||
|
string hash = "XXXXXX";
|
||||||
|
DatItem datItem = new Rom();
|
||||||
|
datItem.SetFieldValue(Models.Metadata.Rom.SpamSumKey, hash);
|
||||||
|
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal($"_{hash}", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void GetDuplicateSuffix_Other_Generic()
|
||||||
|
{
|
||||||
|
DatItem datItem = new Sample();
|
||||||
|
string actual = DatFile.GetDuplicateSuffix(datItem);
|
||||||
|
Assert.Equal("_1", actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region ResolveNames
|
#region ResolveNames
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -721,6 +721,22 @@ namespace SabreTools.DatFiles
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unique duplicate suffix on name collision
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String representing the suffix</returns>
|
||||||
|
protected static internal string GetDuplicateSuffix(DatItem datItem)
|
||||||
|
{
|
||||||
|
return datItem switch
|
||||||
|
{
|
||||||
|
Disk diskItem => GetDuplicateSuffix(diskItem),
|
||||||
|
DatItems.Formats.File fileItem => GetDuplicateSuffix(fileItem),
|
||||||
|
Media mediaItem => GetDuplicateSuffix(mediaItem),
|
||||||
|
Rom romItem => GetDuplicateSuffix(romItem),
|
||||||
|
_ => "_1",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolve name duplicates in an arbitrary set of DatItems based on the supplied information
|
/// Resolve name duplicates in an arbitrary set of DatItems based on the supplied information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -781,7 +797,7 @@ namespace SabreTools.DatFiles
|
|||||||
_logger.Verbose($"Name duplicate found for '{datItemName}'");
|
_logger.Verbose($"Name duplicate found for '{datItemName}'");
|
||||||
|
|
||||||
// Get the duplicate suffix
|
// Get the duplicate suffix
|
||||||
datItemName += datItem.GetDuplicateSuffix();
|
datItemName += GetDuplicateSuffix(datItem);
|
||||||
lastrenamed ??= datItemName;
|
lastrenamed ??= datItemName;
|
||||||
|
|
||||||
// If we have a conflict with the last renamed item, do the right thing
|
// If we have a conflict with the last renamed item, do the right thing
|
||||||
@@ -882,7 +898,7 @@ namespace SabreTools.DatFiles
|
|||||||
_logger.Verbose($"Name duplicate found for '{datItemName}'");
|
_logger.Verbose($"Name duplicate found for '{datItemName}'");
|
||||||
|
|
||||||
// Get the duplicate suffix
|
// Get the duplicate suffix
|
||||||
datItemName += datItem.Value.GetDuplicateSuffix();
|
datItemName += GetDuplicateSuffix(datItem.Value);
|
||||||
lastrenamed ??= datItemName;
|
lastrenamed ??= datItemName;
|
||||||
|
|
||||||
// If we have a conflict with the last renamed item, do the right thing
|
// If we have a conflict with the last renamed item, do the right thing
|
||||||
@@ -989,6 +1005,108 @@ namespace SabreTools.DatFiles
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unique duplicate suffix on name collision
|
||||||
|
/// </summary>
|
||||||
|
private static string GetDuplicateSuffix(Disk datItem)
|
||||||
|
{
|
||||||
|
string? md5 = datItem.GetStringFieldValue(Models.Metadata.Disk.MD5Key);
|
||||||
|
if (!string.IsNullOrEmpty(md5))
|
||||||
|
return $"_{md5}";
|
||||||
|
|
||||||
|
string? sha1 = datItem.GetStringFieldValue(Models.Metadata.Disk.SHA1Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha1))
|
||||||
|
return $"_{sha1}";
|
||||||
|
|
||||||
|
return "_1";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unique duplicate suffix on name collision
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String representing the suffix</returns>
|
||||||
|
private static string GetDuplicateSuffix(DatItems.Formats.File datItem)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(datItem.CRC))
|
||||||
|
return $"_{datItem.CRC}";
|
||||||
|
else if (!string.IsNullOrEmpty(datItem.MD5))
|
||||||
|
return $"_{datItem.MD5}";
|
||||||
|
else if (!string.IsNullOrEmpty(datItem.SHA1))
|
||||||
|
return $"_{datItem.SHA1}";
|
||||||
|
else if (!string.IsNullOrEmpty(datItem.SHA256))
|
||||||
|
return $"_{datItem.SHA256}";
|
||||||
|
else
|
||||||
|
return "_1";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unique duplicate suffix on name collision
|
||||||
|
/// </summary>
|
||||||
|
private static string GetDuplicateSuffix(Media datItem)
|
||||||
|
{
|
||||||
|
string? md5 = datItem.GetStringFieldValue(Models.Metadata.Media.MD5Key);
|
||||||
|
if (!string.IsNullOrEmpty(md5))
|
||||||
|
return $"_{md5}";
|
||||||
|
|
||||||
|
string? sha1 = datItem.GetStringFieldValue(Models.Metadata.Media.SHA1Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha1))
|
||||||
|
return $"_{sha1}";
|
||||||
|
|
||||||
|
string? sha256 = datItem.GetStringFieldValue(Models.Metadata.Media.SHA256Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha256))
|
||||||
|
return $"_{sha256}";
|
||||||
|
|
||||||
|
string? spamSum = datItem.GetStringFieldValue(Models.Metadata.Media.SpamSumKey);
|
||||||
|
if (!string.IsNullOrEmpty(spamSum))
|
||||||
|
return $"_{spamSum}";
|
||||||
|
|
||||||
|
return "_1";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unique duplicate suffix on name collision
|
||||||
|
/// </summary>
|
||||||
|
private static string GetDuplicateSuffix(Rom datItem)
|
||||||
|
{
|
||||||
|
string? crc = datItem.GetStringFieldValue(Models.Metadata.Rom.CRCKey);
|
||||||
|
if (!string.IsNullOrEmpty(crc))
|
||||||
|
return $"_{crc}";
|
||||||
|
|
||||||
|
string? md2 = datItem.GetStringFieldValue(Models.Metadata.Rom.MD2Key);
|
||||||
|
if (!string.IsNullOrEmpty(md2))
|
||||||
|
return $"_{md2}";
|
||||||
|
|
||||||
|
string? md4 = datItem.GetStringFieldValue(Models.Metadata.Rom.MD4Key);
|
||||||
|
if (!string.IsNullOrEmpty(md4))
|
||||||
|
return $"_{md4}";
|
||||||
|
|
||||||
|
string? md5 = datItem.GetStringFieldValue(Models.Metadata.Rom.MD5Key);
|
||||||
|
if (!string.IsNullOrEmpty(md5))
|
||||||
|
return $"_{md5}";
|
||||||
|
|
||||||
|
string? sha1 = datItem.GetStringFieldValue(Models.Metadata.Rom.SHA1Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha1))
|
||||||
|
return $"_{sha1}";
|
||||||
|
|
||||||
|
string? sha256 = datItem.GetStringFieldValue(Models.Metadata.Rom.SHA256Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha256))
|
||||||
|
return $"_{sha256}";
|
||||||
|
|
||||||
|
string? sha384 = datItem.GetStringFieldValue(Models.Metadata.Rom.SHA384Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha384))
|
||||||
|
return $"_{sha384}";
|
||||||
|
|
||||||
|
string? sha512 = datItem.GetStringFieldValue(Models.Metadata.Rom.SHA512Key);
|
||||||
|
if (!string.IsNullOrEmpty(sha512))
|
||||||
|
return $"_{sha512}";
|
||||||
|
|
||||||
|
string? spamSum = datItem.GetStringFieldValue(Models.Metadata.Rom.SpamSumKey);
|
||||||
|
if (!string.IsNullOrEmpty(spamSum))
|
||||||
|
return $"_{spamSum}";
|
||||||
|
|
||||||
|
return "_1";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sort a list of DatItem objects by SourceID, Game, and Name (in order)
|
/// Sort a list of DatItem objects by SourceID, Game, and Name (in order)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -101,40 +101,6 @@ namespace SabreTools.DatItems.Test.Formats
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetDuplicateSuffix
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_NoHash_Generic()
|
|
||||||
{
|
|
||||||
Disk self = new Disk();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Disk self = new Disk();
|
|
||||||
self.SetFieldValue(Models.Metadata.Disk.MD5Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_Disk_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Disk self = new Disk();
|
|
||||||
self.SetFieldValue(Models.Metadata.Disk.SHA1Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region HasHashes
|
#region HasHashes
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -96,58 +96,6 @@ namespace SabreTools.DatItems.Test.Formats
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetDuplicateSuffix
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_NoHash_Generic()
|
|
||||||
{
|
|
||||||
File self = new File();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_CRC()
|
|
||||||
{
|
|
||||||
string hash = "deadbeef";
|
|
||||||
File self = new File { CRC = hash };
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_MD5()
|
|
||||||
{
|
|
||||||
string hash = "000000000000000000000000deadbeef";
|
|
||||||
File self = new File { MD5 = hash };
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "00000000000000000000000000000000deadbeef";
|
|
||||||
File self = new File { SHA1 = hash };
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA256()
|
|
||||||
{
|
|
||||||
string hash = "00000000000000000000000000000000000000000000000000000000deadbeef";
|
|
||||||
File self = new File { SHA256 = hash };
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region HasHashes
|
#region HasHashes
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -87,62 +87,6 @@ namespace SabreTools.DatItems.Test.Formats
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetDuplicateSuffix
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_NoHash_Generic()
|
|
||||||
{
|
|
||||||
Media self = new Media();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Media self = new Media();
|
|
||||||
self.SetFieldValue(Models.Metadata.Media.MD5Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Media self = new Media();
|
|
||||||
self.SetFieldValue(Models.Metadata.Media.SHA1Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA256()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Media self = new Media();
|
|
||||||
self.SetFieldValue(Models.Metadata.Media.SHA256Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SpamSum()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Media self = new Media();
|
|
||||||
self.SetFieldValue(Models.Metadata.Media.SpamSumKey, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region HasHashes
|
#region HasHashes
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -58,117 +58,6 @@ namespace SabreTools.DatItems.Test.Formats
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetDuplicateSuffix
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_NoHash_Generic()
|
|
||||||
{
|
|
||||||
Rom self = new Rom();
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal("_1", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_CRC()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.CRCKey, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_MD2()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.MD2Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_MD4()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.MD4Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_MD5()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.MD5Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA1()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.SHA1Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA256()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.SHA256Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA384()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.SHA384Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SHA512()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.SHA512Key, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void GetDuplicateSuffix_SpamSum()
|
|
||||||
{
|
|
||||||
string hash = "XXXXXX";
|
|
||||||
Rom self = new Rom();
|
|
||||||
self.SetFieldValue(Models.Metadata.Rom.SpamSumKey, hash);
|
|
||||||
|
|
||||||
string actual = self.GetDuplicateSuffix();
|
|
||||||
Assert.Equal($"_{hash}", actual);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region HasHashes
|
#region HasHashes
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -264,12 +264,6 @@ namespace SabreTools.DatItems
|
|||||||
|
|
||||||
#region Sorting and Merging
|
#region Sorting and Merging
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>String representing the suffix</returns>
|
|
||||||
public virtual string GetDuplicateSuffix() => _internal.GetDuplicateSuffix();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the dictionary key that should be used for a given item and bucketing type
|
/// Get the dictionary key that should be used for a given item and bucketing type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -212,24 +212,6 @@ namespace SabreTools.DatItems.Formats
|
|||||||
_sha256 = other._sha256;
|
_sha256 = other._sha256;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get unique duplicate suffix on name collision
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>String representing the suffix</returns>
|
|
||||||
public override string GetDuplicateSuffix()
|
|
||||||
{
|
|
||||||
if (!_crc.IsNullOrEmpty())
|
|
||||||
return $"_{CRC}";
|
|
||||||
else if (!_md5.IsNullOrEmpty())
|
|
||||||
return $"_{MD5}";
|
|
||||||
else if (!_sha1.IsNullOrEmpty())
|
|
||||||
return $"_{SHA1}";
|
|
||||||
else if (!_sha256.IsNullOrEmpty())
|
|
||||||
return $"_{SHA256}";
|
|
||||||
else
|
|
||||||
return "_1";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns if the File contains any hashes
|
/// Returns if the File contains any hashes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user