Remove DalamudBetaKey, DalamudBetaKind from config

Fix all code that depends on it to use Util.GetActiveTrack() instead
This commit is contained in:
goaaats 2025-11-29 19:15:37 +01:00
parent 6367a66aad
commit d12a9ec7da
6 changed files with 24 additions and 32 deletions

View file

@ -3,6 +3,7 @@ using System.Threading.Tasks;
using Dalamud.Configuration.Internal;
using Dalamud.Networking.Http;
using Dalamud.Utility;
using Newtonsoft.Json;
@ -15,7 +16,7 @@ namespace Dalamud.Support;
internal class DalamudReleases : IServiceType
{
private const string VersionInfoUrl = "https://kamori.goats.dev/Dalamud/Release/VersionInfo?track={0}";
private readonly HappyHttpClient httpClient;
private readonly DalamudConfiguration config;
@ -30,20 +31,24 @@ internal class DalamudReleases : IServiceType
this.httpClient = httpClient;
this.config = config;
}
/// <summary>
/// Get the latest version info for the current track.
/// </summary>
/// <returns>The version info for the current track.</returns>
public async Task<DalamudVersionInfo> GetVersionForCurrentTrack()
public async Task<DalamudVersionInfo?> GetVersionForCurrentTrack()
{
var url = string.Format(VersionInfoUrl, [this.config.DalamudBetaKind]);
var currentTrack = Util.GetActiveTrack();
if (currentTrack.IsNullOrEmpty())
return null;
var url = string.Format(VersionInfoUrl, [currentTrack]);
var response = await this.httpClient.SharedHttpClient.GetAsync(url);
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<DalamudVersionInfo>(content);
}
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "laziness")]
public class DalamudVersionInfo
{

View file

@ -73,7 +73,7 @@ public static class Troubleshooting
DalamudGitHash = Util.GetGitHash() ?? "Unknown",
GameVersion = startInfo.GameVersion?.ToString() ?? "Unknown",
Language = startInfo.Language.ToString(),
BetaKey = configuration.DalamudBetaKey,
BetaKey = Util.GetActiveTrack(),
DoPluginTest = configuration.DoPluginTest,
LoadAllApiLevels = pluginManager?.LoadAllApiLevels == true,
InterfaceLoaded = interfaceManager?.IsReady ?? false,