Merge pull request #531 from djlorenzouasset/dev
Some checks failed
FModel QA Builder / build (push) Has been cancelled

authorization token change + check if a release is downloadable
This commit is contained in:
Valentin 2024-12-14 18:54:00 +01:00 committed by GitHub
commit 09da05218c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 9 deletions

View File

@ -16,7 +16,7 @@ namespace FModel.ViewModels.ApiEndpoints;
public class EpicApiEndpoint : AbstractApiProvider
{
private const string _OAUTH_URL = "https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token";
private const string _BASIC_TOKEN = "basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=";
private const string _BASIC_TOKEN = "basic ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ=";
private const string _APP_URL = "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/public/assets/v2/platform/Windows/namespace/fn/catalogItem/4fe75bbc5a674f4f9b356b5c90567da5/app/Fortnite/label/Live";
public EpicApiEndpoint(RestClient client) : base(client) { }

View File

@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using FModel.Framework;
using FModel.ViewModels.ApiEndpoints.Models;
using RestSharp;
@ -9,7 +9,7 @@ public class GitHubApiEndpoint : AbstractApiProvider
{
public GitHubApiEndpoint(RestClient client) : base(client) { }
public async Task<GitHubCommit[]> GetCommitHistoryAsync(string branch = "dev", int page = 1, int limit = 20)
public async Task<GitHubCommit[]> GetCommitHistoryAsync(string branch = "dev", int page = 1, int limit = 30)
{
var request = new FRestRequest(Constants.GH_COMMITS_HISTORY);
request.AddParameter("sha", branch);

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
@ -40,10 +40,13 @@ public class UpdateViewModel : ViewModel
Commits.AddRange(await _apiEndpointView.GitHubApi.GetCommitHistoryAsync());
var qa = await _apiEndpointView.GitHubApi.GetReleaseAsync("qa");
qa.Assets.OrderByDescending(x => x.CreatedAt).First().IsLatest = true;
var assets = qa.Assets.OrderByDescending(x => x.CreatedAt).ToList();
foreach (var asset in qa.Assets)
for (var i = 0; i < assets.Count; i++)
{
var asset = assets[i];
asset.IsLatest = i == 0;
var commitSha = asset.Name.SubstringBeforeLast(".zip");
var commit = Commits.FirstOrDefault(x => x.Sha == commitSha);
if (commit != null)
@ -69,6 +72,6 @@ public class UpdateViewModel : ViewModel
public void DownloadLatest()
{
Commits.FirstOrDefault(x => x.Asset.IsLatest)?.Download();
Commits.FirstOrDefault(x => x.IsDownloadable && x.Asset.IsLatest)?.Download();
}
}

View File

@ -235,8 +235,8 @@ public class Texture : IDisposable
SnimGui.Layout("Type");ImGui.Text($" : ({Format}) {Name}");
SnimGui.TooltipCopy("(?) Click to Copy Path", Path);
SnimGui.Layout("Guid");ImGui.Text($" : {Guid.ToString(EGuidFormats.UniqueObjectGuid)}");
SnimGui.Layout("Import");ImGui.Text($" : {ImportedWidth}x{ImportedHeight}");
SnimGui.Layout("Export");ImGui.Text($" : {Width}x{Height}");
SnimGui.Layout("Size");
ImGui.Text($" : {Width}x{Height}");
SnimGui.Layout("Swizzle");
for (int c = 0; c < SwizzleMask.Length; c++)