2019-10-07 17:33:34 +00:00
|
|
|
|
using Wabbajack.Common;
|
2019-09-26 20:18:41 +00:00
|
|
|
|
|
2019-10-16 03:10:34 +00:00
|
|
|
|
namespace Wabbajack.Lib.NexusApi
|
2019-09-26 20:18:41 +00:00
|
|
|
|
{
|
|
|
|
|
public sealed class NexusApiUtils
|
|
|
|
|
{
|
|
|
|
|
public static string ConvertGameName(string gameName)
|
|
|
|
|
{
|
2019-09-29 00:18:42 +00:00
|
|
|
|
return GameRegistry.GetByMO2ArchiveName(gameName)?.NexusName ?? gameName.ToLower();
|
2019-09-26 20:18:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetModURL(string argGameName, string argModId)
|
|
|
|
|
{
|
|
|
|
|
return $"https://nexusmods.com/{ConvertGameName(argGameName)}/mods/{argModId}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string FixupSummary(string argSummary)
|
|
|
|
|
{
|
|
|
|
|
if (argSummary != null)
|
|
|
|
|
{
|
|
|
|
|
return argSummary.Replace("'", "'")
|
|
|
|
|
.Replace("<br/>", "\n\n")
|
|
|
|
|
.Replace("<br />", "\n\n")
|
|
|
|
|
.Replace("!", "!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return argSummary;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|