mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
bec10fdea1
- Moved NexusApiClient and all of its Dtos into their own package. - Moved util methods into a new util class. - NexusApi no longer creates new HttpClients for each request and uses one internal HttpClient instead. - Added rudimentary tracking of rate limits.
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Wabbajack.NexusApi
|
|
{
|
|
public sealed class NexusApiUtils
|
|
{
|
|
public static string ConvertGameName(string gameName)
|
|
{
|
|
if (gameName == "SkyrimSE") return "skyrimspecialedition";
|
|
if (gameName == "FalloutNV") return "newvegas";
|
|
return gameName.ToLower();
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|