qa testing test

This commit is contained in:
Asval 2023-11-04 18:09:07 +01:00
parent 5e5051628d
commit ef94d35ca2
8 changed files with 42 additions and 14 deletions

@ -1 +1 @@
Subproject commit 94b08d6022a8577732e805e5140931d318204c82
Subproject commit 3ff8c179dfbe817f22e9672dab9c2901a58b9db7

View File

@ -71,7 +71,9 @@ public enum EUpdateMode
[Description("Stable")]
Stable,
[Description("Beta")]
Beta
Beta,
[Description("QA Testing")]
Qa
}
public enum ECompressedAudio

View File

@ -47,7 +47,7 @@ public partial class MainWindow
{
var newOrUpdated = UserSettings.Default.ShowChangelog;
#if !DEBUG
ApplicationService.ApiEndpointView.FModelApi.CheckForUpdates(UserSettings.Default.UpdateMode);
ApplicationService.ApiEndpointView.FModelApi.CheckForUpdates(UserSettings.Default.UpdateMode, true);
#endif
switch (UserSettings.Default.AesReload)

View File

@ -159,6 +159,13 @@ namespace FModel.Settings
set => SetProperty(ref _updateMode, value);
}
private string _commitId = Constants.APP_VERSION;
public string CommitId
{
get => _commitId;
set => SetProperty(ref _commitId, value);
}
private bool _keepDirectoryStructure = true;
public bool KeepDirectoryStructure
{
@ -231,6 +238,8 @@ namespace FModel.Settings
[JsonIgnore]
public DirectorySettings CurrentDir { get; set; }
[JsonIgnore]
public string ShortCommitId => CommitId[..7];
/// <summary>
/// TO DELETEEEEEEEEEEEEE

View File

@ -116,10 +116,13 @@ public class FModelApiEndpoint : AbstractApiProvider
return communityDesign;
}
public void CheckForUpdates(EUpdateMode updateMode)
public void CheckForUpdates(EUpdateMode updateMode, bool launch = false)
{
AutoUpdater.ParseUpdateInfoEvent += ParseUpdateInfoEvent;
AutoUpdater.CheckForUpdateEvent += CheckForUpdateEvent;
if (launch)
{
AutoUpdater.ParseUpdateInfoEvent += ParseUpdateInfoEvent;
AutoUpdater.CheckForUpdateEvent += CheckForUpdateEvent;
}
AutoUpdater.Start($"https://api.fmodel.app/v1/infos/{updateMode}");
}
@ -130,9 +133,14 @@ public class FModelApiEndpoint : AbstractApiProvider
{
args.UpdateInfo = new UpdateInfoEventArgs
{
CurrentVersion = _infos.Version,
CurrentVersion = _infos.Version.SubstringBefore('-'),
ChangelogURL = _infos.ChangelogUrl,
DownloadURL = _infos.DownloadUrl
DownloadURL = _infos.DownloadUrl,
Mandatory = new CustomMandatory
{
Value = UserSettings.Default.UpdateMode == EUpdateMode.Qa,
CommitId = _infos.Version.SubstringAfter('+')
}
};
}
}
@ -141,8 +149,10 @@ public class FModelApiEndpoint : AbstractApiProvider
{
if (args is { CurrentVersion: { } })
{
var qa = (CustomMandatory) args.Mandatory;
var currentVersion = new System.Version(args.CurrentVersion);
if (currentVersion == args.InstalledVersion)
if ((qa.Value && qa.CommitId == UserSettings.Default.CommitId) || // qa branch : same commit id
(!qa.Value && currentVersion == args.InstalledVersion && args.CurrentVersion == UserSettings.Default.CommitId)) // stable - beta branch : same version + commit id = version
{
if (UserSettings.Default.ShowChangelog)
ShowChangelog(args);
@ -152,7 +162,7 @@ public class FModelApiEndpoint : AbstractApiProvider
var downgrade = currentVersion < args.InstalledVersion;
var messageBox = new MessageBoxModel
{
Text = $"The latest version of FModel {UserSettings.Default.UpdateMode} is {args.CurrentVersion}. You are using version {args.InstalledVersion}. Do you want to {(downgrade ? "downgrade" : "update")} the application now?",
Text = $"The latest version of FModel {UserSettings.Default.UpdateMode.GetDescription()} is {(qa.Value ? qa.ShortCommitId : args.CurrentVersion)}. You are using version {(qa.Value ? UserSettings.Default.ShortCommitId : args.InstalledVersion)}. Do you want to {(downgrade ? "downgrade" : "update")} the application now?",
Caption = $"{(downgrade ? "Downgrade" : "Update")} Available",
Icon = MessageBoxImage.Question,
Buttons = MessageBoxButtons.YesNo(),
@ -167,6 +177,7 @@ public class FModelApiEndpoint : AbstractApiProvider
if (AutoUpdater.DownloadUpdate(args))
{
UserSettings.Default.ShowChangelog = true;
UserSettings.Default.CommitId = qa.CommitId;
Application.Current.Shutdown();
}
}
@ -196,3 +207,9 @@ public class FModelApiEndpoint : AbstractApiProvider
UserSettings.Default.ShowChangelog = false;
}
}
public class CustomMandatory : Mandatory
{
public string CommitId { get; set; }
public string ShortCommitId => CommitId[..7];
}

View File

@ -46,7 +46,7 @@ public class ApplicationViewModel : ViewModel
public CopyCommand CopyCommand => _copyCommand ??= new CopyCommand(this);
private CopyCommand _copyCommand;
public string InitialWindowTitle => $"FModel {UserSettings.Default.UpdateMode}";
public string InitialWindowTitle => $"FModel {UserSettings.Default.UpdateMode.GetDescription()}";
public string GameDisplayName => CUE4Parse.Provider.GameDisplayName ?? "Unknown";
public string TitleExtra => $"({UserSettings.Default.CurrentDir.UeVersion}){(Build != EBuildKind.Release ? $" ({Build})" : "")}";

View File

@ -87,8 +87,8 @@ public class GameSelectorViewModel : ViewModel
.OrderBy(value => (int)value == ((int)value & ~0xF));
private IEnumerable<DirectorySettings> EnumerateDetectedGames()
{
yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_3);
yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_3);
yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_4);
yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_4);
yield return GetUnrealEngineGame("Pewee", "\\RogueCompany\\Content\\Paks", EGame.GAME_RogueCompany);
yield return GetUnrealEngineGame("Rosemallow", "\\Indiana\\Content\\Paks", EGame.GAME_UE4_21);
yield return GetUnrealEngineGame("Catnip", "\\OakGame\\Content\\Paks", EGame.GAME_Borderlands3);

View File

@ -142,7 +142,7 @@ public partial class ImageMerger
var fileBrowser = new OpenFileDialog
{
Title = "Add image(s)",
InitialDirectory = $"{UserSettings.Default.OutputDirectory}\\Exports",
InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"),
Multiselect = true,
Filter = "Image Files (*.png,*.bmp,*.jpg,*.jpeg,*.jfif,*.jpe,*.tiff,*.tif)|*.png;*.bmp;*.jpg;*.jpeg;*.jfif;*.jpe;*.tiff;*.tif|All Files (*.*)|*.*"
};