Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview 1.82.16 Hotfix Release #679

Open
wants to merge 31 commits into
base: preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
faf5476
[skip ci] Update README.md
neon-nyan Jan 28, 2025
3bc65b8
Avoid early dispose on Stream Hashing methods
neon-nyan Jan 29, 2025
c06d196
Allow Hash methods to run with LongRunning flag
neon-nyan Jan 31, 2025
dce1f09
Use element return instead of tuple
neon-nyan Jan 31, 2025
7ae1dbb
Bump version + Update NuGet
neon-nyan Jan 31, 2025
93eae61
Rename Legacy Launcher Api classes
neon-nyan Jan 31, 2025
33279cc
[skip ci] Sync translation Translate en_US.json in zh_CN
transifex-integration[bot] Jan 31, 2025
8e11b87
[skip ci] [CI] Tryfix VirusTotal scanner
bagusnl Jan 31, 2025
f5fb349
[Attempt] Hanging thread fix
neon-nyan Jan 31, 2025
0238c45
Remove unnecessary ref return on UIElement extensions
neon-nyan Jan 31, 2025
317d6e5
Make PresetConfig Metadata loads in Parallel
neon-nyan Jan 31, 2025
1947080
Always ensure to flush CommunityTools Dictionary
neon-nyan Jan 31, 2025
2237519
[Attempt 2] Hanging thread fix
neon-nyan Feb 1, 2025
7e3f3f1
Bunch of other CodeQAs
neon-nyan Feb 1, 2025
fb4a618
Make SonarQube happy :)
neon-nyan Feb 1, 2025
72084d9
Adjust event icon size
neon-nyan Feb 1, 2025
ee32899
Run ConfiguredTaskAwaitable callback as Task
neon-nyan Feb 1, 2025
1ce88dd
Remove redundant token capture
neon-nyan Feb 1, 2025
b5eaf18
Fix crash on LoadLocalNotificationData
neon-nyan Feb 1, 2025
a3b2c1e
Use CanvasBitmap instead of SoftwareBitmap to draw video frame
neon-nyan Feb 1, 2025
c609bfd
Reassign to use default image if video fails
neon-nyan Feb 1, 2025
a4510a4
Remove unused namespace
neon-nyan Feb 1, 2025
e242dcc
Use StorageItemThumbnail directly as stream
neon-nyan Feb 2, 2025
3863fdb
Another video playback improvements
neon-nyan Feb 2, 2025
35eede7
Always suspend drawing session before disposing
neon-nyan Feb 2, 2025
7751c57
Lock drawing routine and allow frame skip
neon-nyan Feb 2, 2025
9adb3dc
Fix race condition on FrameGrabberEvent
neon-nyan Feb 2, 2025
4ca0340
Use stackalloc on dash-hreader check
neon-nyan Feb 2, 2025
c8b49d2
Immediately dispose the draw session
neon-nyan Feb 2, 2025
1ed22e9
Dynamically change canvas size + Fix incorrect canvas size
neon-nyan Feb 2, 2025
65bb262
CodeQA
neon-nyan Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/vt-scan-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ jobs:
virustotal:
runs-on: ubuntu-latest
steps:
-
name: VirusTotal Scan
- name: VirusTotal Scan Executables
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
update_release_body: true
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
*.exe
*.7z

- name: VirusTotal Scan Archive
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
update_release_body: true
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
*.7z
2 changes: 1 addition & 1 deletion CollapseLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
WindowUtility.CurrentAppWindow!.TitleBar!.ButtonForegroundColor = color;
WindowUtility.CurrentAppWindow!.TitleBar!.ButtonInactiveBackgroundColor = color;

if (WindowUtility.CurrentWindow!.Content is not null and FrameworkElement frameworkElement)
if (WindowUtility.CurrentWindow!.Content is FrameworkElement frameworkElement)
frameworkElement.RequestedTheme = isThemeLight ? ElementTheme.Light : ElementTheme.Dark;
};

Expand Down
6 changes: 3 additions & 3 deletions CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private async ValueTask CheckAsset(CacheAsset asset, List<CacheAsset> returnAsse
}
}

private void AddGenericCheckAsset(CacheAsset asset, CacheAssetStatus assetStatus, List<CacheAsset> returnAsset, byte[] localCRC, byte[] remoteCRC)
private void AddGenericCheckAsset(CacheAsset asset, CacheAssetStatus assetStatus, List<CacheAsset> returnAsset, byte[] localCrc, byte[] remoteCrc)
{
// Increment the count and total size
lock (this)
Expand All @@ -187,8 +187,8 @@ private void AddGenericCheckAsset(CacheAsset asset, CacheAssetStatus assetStatus
asset.DataType,
Path.GetDirectoryName(asset.N),
asset.CS,
localCRC,
remoteCRC
localCrc,
remoteCrc
))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private async Task<bool> CheckRoutine()
// Step 2: Start assets checking
UpdateAssetIndex = await Check(AssetIndex, Token!.Token);

// Step 3: Summarize and returns true if the assetIndex count != 0 indicates caches needs to be update.
// Step 3: Summarize and returns true if the assetIndex count != 0 indicates caches needs to be updated.
// either way, returns false.
return SummarizeStatusAndProgress(
UpdateAssetIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private async Task<bool> CheckRoutine()
// Step 2: Start assets checking
UpdateAssetIndex = await Check(AssetIndex, Token.Token);

// Step 3: Summarize and returns true if the assetIndex count != 0 indicates caches needs to be update.
// Step 3: Summarize and returns true if the assetIndex count != 0 indicates caches needs to be updated.
// either way, returns false.
return SummarizeStatusAndProgress(
UpdateAssetIndex,
Expand Down
1 change: 1 addition & 0 deletions CollapseLauncher/Classes/EventsManagement/EventsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// ReSharper disable SwitchStatementHandlesSomeKnownEnumValuesWithDefault
// ReSharper disable IdentifierTypo
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable UnusedMember.Global

namespace CollapseLauncher
{
Expand Down
45 changes: 45 additions & 0 deletions CollapseLauncher/Classes/Extension/TaskExtensions.TaskAwaitable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
// ReSharper disable UnusedMember.Global

#nullable enable
namespace CollapseLauncher.Extension
{
public delegate ConfiguredTaskAwaitable<TResult?> ActionTimeoutTaskAwaitableCallback<TResult>(CancellationToken token);

internal static partial class TaskExtensions
{
internal static Task<TResult?>
WaitForRetryAsync<TResult>(this ActionTimeoutTaskAwaitableCallback<TResult?> funcCallback,
int? timeout = null,
int? timeoutStep = null,
int? retryAttempt = null,
ActionOnTimeOutRetry? actionOnRetry = null,
CancellationToken fromToken = default)
=> WaitForRetryAsync(() => funcCallback, timeout, timeoutStep, retryAttempt, actionOnRetry, fromToken);

internal static async Task<TResult?>
WaitForRetryAsync<TResult>(Func<ActionTimeoutTaskAwaitableCallback<TResult?>> funcCallback,
int? timeout = null,
int? timeoutStep = null,
int? retryAttempt = null,
ActionOnTimeOutRetry? actionOnRetry = null,
CancellationToken fromToken = default)
=> await WaitForRetryAsync(funcCallback.AsTaskCallback,
timeout,
timeoutStep,
retryAttempt,
actionOnRetry,
fromToken);

private static ActionTimeoutTaskCallback<TResult?> AsTaskCallback<TResult>(this Func<ActionTimeoutTaskAwaitableCallback<TResult?>> func) =>
async ctx =>
{
ActionTimeoutTaskAwaitableCallback<TResult?> callback = func.Invoke();
ConfiguredTaskAwaitable<TResult?> callbackAwaitable = callback.Invoke(ctx);
return await callbackAwaitable;
};
}
}
37 changes: 21 additions & 16 deletions CollapseLauncher/Classes/Extension/TaskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,38 @@
using System;
using System.Threading;
using System.Threading.Tasks;
// ReSharper disable UnusedMember.Global

#nullable enable
namespace CollapseLauncher.Extension
{
public delegate Task<TResult?> ActionTimeoutValueTaskCallback<TResult>(CancellationToken token);
public delegate Task<TResult?> ActionTimeoutTaskCallback<TResult>(CancellationToken token);
public delegate void ActionOnTimeOutRetry(int retryAttemptCount, int retryAttemptTotal, int timeOutSecond, int timeOutStep);
internal static class TaskExtensions

internal static partial class TaskExtensions
{
internal const int DefaultTimeoutSec = 10;
internal const int DefaultRetryAttempt = 5;

internal static async Task AsTaskAndDoAction<TResult>(this Task<TResult?> taskResult, Action<TResult?> doAction)
{
TResult? result = await taskResult;
doAction(result);
}

internal static async Task<TResult?> WaitForRetryAsync<TResult>(this ActionTimeoutValueTaskCallback<TResult?> funcCallback, int? timeout = null,
int? timeoutStep = null, int? retryAttempt = null, ActionOnTimeOutRetry? actionOnRetry = null, CancellationToken fromToken = default)
internal static async Task<TResult?>
WaitForRetryAsync<TResult>(this ActionTimeoutTaskCallback<TResult?> funcCallback,
int? timeout = null,
int? timeoutStep = null,
int? retryAttempt = null,
ActionOnTimeOutRetry? actionOnRetry = null,
CancellationToken fromToken = default)
=> await WaitForRetryAsync(() => funcCallback, timeout, timeoutStep, retryAttempt, actionOnRetry, fromToken);

internal static async Task<TResult?> WaitForRetryAsync<TResult>(Func<ActionTimeoutValueTaskCallback<TResult?>> funcCallback, int? timeout = null,
int? timeoutStep = null, int? retryAttempt = null, ActionOnTimeOutRetry? actionOnRetry = null, CancellationToken fromToken = default)
internal static async Task<TResult?>
WaitForRetryAsync<TResult>(Func<ActionTimeoutTaskCallback<TResult?>> funcCallback,
int? timeout = null,
int? timeoutStep = null,
int? retryAttempt = null,
ActionOnTimeOutRetry? actionOnRetry = null,
CancellationToken fromToken = default)
{
timeout ??= DefaultTimeoutSec;
timeoutStep ??= 0;

timeout ??= DefaultTimeoutSec;
timeoutStep ??= 0;
retryAttempt ??= DefaultRetryAttempt;

int retryAttemptCurrent = 1;
Expand All @@ -44,7 +49,7 @@ internal static async Task AsTaskAndDoAction<TResult>(this Task<TResult?> taskRe
innerCancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(timeout ?? DefaultTimeoutSec));
consolidatedToken = CancellationTokenSource.CreateLinkedTokenSource(innerCancellationToken.Token, fromToken);

ActionTimeoutValueTaskCallback<TResult?> delegateCallback = funcCallback();
ActionTimeoutTaskCallback<TResult?> delegateCallback = funcCallback();
return await delegateCallback(consolidatedToken.Token);
}
catch (OperationCanceledException) when (fromToken.IsCancellationRequested) { throw; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ internal static partial class UIElementExtensions
/// </summary>
/// <param name="element">The <seealso cref="UIElement"/> member of an element</param>
/// <param name="inputCursor">The cursor you want to set. Use <see cref="InputSystemCursor.Create"/> to choose the cursor you want to set.</param>
internal static ref T WithCursor<T>(this T element, InputCursor inputCursor) where T : UIElement
internal static T WithCursor<T>(this T element, InputCursor inputCursor) where T : UIElement
{
element.SetCursor(inputCursor);
return ref Unsafe.AsRef(ref element);
return element;
}
}
}
Loading
Loading