fixup the report for the new downloaders

This commit is contained in:
Timothy Baldridge 2019-10-12 16:54:25 -06:00
parent 4e946facab
commit c7f2427d17
7 changed files with 34 additions and 27 deletions

View File

@ -32,5 +32,7 @@ namespace Wabbajack.Downloaders
public abstract bool Verify();
public abstract IDownloader GetDownloader();
public abstract string GetReportEntry(Archive a);
}
}

View File

@ -67,6 +67,11 @@ namespace Wabbajack.Downloaders
{
return DownloadDispatcher.GetInstance<GoogleDriveDownloader>();
}
public override string GetReportEntry(Archive a)
{
return $"* GoogleDrive - [{a.Name}](https://drive.google.com/uc?id={Id}&export=download)";
}
}
}
}

View File

@ -128,6 +128,11 @@ namespace Wabbajack.Downloaders
{
return DownloadDispatcher.GetInstance<HTTPDownloader>();
}
public override string GetReportEntry(Archive a)
{
return $"* URL - [{a.Name} - {Url}]({Url})";
}
}
}
}

View File

@ -42,6 +42,11 @@ namespace Wabbajack.Downloaders
{
return DownloadDispatcher.GetInstance<ManualDownloader>();
}
public override string GetReportEntry(Archive a)
{
return $"* Manual Download - [{a.Name} - {Url}]({Url})";
}
}
}
}

View File

@ -67,6 +67,11 @@ namespace Wabbajack.Downloaders
{
return DownloadDispatcher.GetInstance<ModDBDownloader>();
}
public override string GetReportEntry(Archive a)
{
return $"* ModDB - [{a.Name}]({Url})";
}
}
}
}

View File

@ -118,6 +118,17 @@ namespace Wabbajack.Downloaders
{
return DownloadDispatcher.GetInstance<NexusDownloader>();
}
public override string GetReportEntry(Archive a)
{
var profile = UploaderProfile.Replace("/games/",
"/" + NexusApiUtils.ConvertGameName(GameName).ToLower() + "/");
return string.Join("\n",
$"* [{a.Name}](http://nexusmods.com/{NexusApiUtils.ConvertGameName(GameName)}/mods/{ModID})",
$" * Author : [{UploadedBy}]({profile})",
$" * Version : {Version}");
}
}
}
}

View File

@ -61,33 +61,7 @@ namespace Wabbajack
foreach (var archive in SortArchives(lst.Archives))
{
var hash = archive.Hash.FromBase64().ToHEX();
switch (archive)
{
/*
case NexusMod m:
var profile = m.UploaderProfile.Replace("/games/",
"/" + NexusApiUtils.ConvertGameName(m.GameName).ToLower() + "/");
NoWrapText(
$"* [{m.Name}](http://nexusmods.com/{NexusApiUtils.ConvertGameName(m.GameName)}/mods/{m.ModID})");
NoWrapText($" * Author : [{m.UploadedBy}]({profile})");
NoWrapText($" * Version : {m.Version}");
break;
case MODDBArchive m:
NoWrapText($"* MODDB - [{m.Name}]({m.URL})");
break;
case MEGAArchive m:
NoWrapText($"* MEGA - [{m.Name}]({m.URL})");
break;
case GoogleDriveMod m:
NoWrapText(
$"* GoogleDrive - [{m.Name}](https://drive.google.com/uc?id={m.Id}&export=download)");
break;
case DirectURLArchive m:
NoWrapText($"* URL - [{m.Name} - {m.URL}]({m.URL})");
break;
*/
}
NoWrapText(archive.State.GetReportEntry(archive));
NoWrapText($" * Size : {archive.Size.ToFileSizeString()}");
NoWrapText($" * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})");
}