Routes the file browser thumbnail requests through the authenticated Web proxy

This commit is contained in:
BinaryAlley committed 2026-08-29 16:35:12 +03:00
1 parent a32f80337b
commit f694882b46
15 files changed
+299 -35

No files matched your search

@@ -19,21 +19,18 @@ public class ThemeFileSystemBrowserConfigurationDtoFixture
/// <summary>
/// Creates a new <see cref="ThemeFileSystemBrowserConfigurationDto"/> instance with randomized test data.
/// </summary>
/// <param name="serverBasePath">Optional base URL of the remote API.</param>
/// <param name="clientBasePath">Optional base URL of the Web application.</param>
/// <param name="path">Optional initial path displayed by the file system browser.</param>
/// <param name="viewMode">Optional initial view mode of the file system browser.</param>
/// <param name="iconSize">Optional initial icon size of the file system browser.</param>
/// <returns>A configured <see cref="ThemeFileSystemBrowserConfigurationDto"/> instance.</returns>
public ThemeFileSystemBrowserConfigurationDto Create(
string? serverBasePath = null,
string? clientBasePath = null,
string? path = null,
string? viewMode = null,
string? iconSize = null)
{
return new ThemeFileSystemBrowserConfigurationDto(
ServerBasePath: serverBasePath ?? $"http://localhost:{_faker.Random.UShort()}/api/v1/",
ClientBasePath: clientBasePath ?? $"http://localhost:{_faker.Random.UShort()}/",
Path: path ?? (_faker.Random.Bool() ? "/" : "C:\\Users\\"),
ViewMode: viewMode ?? _faker.Random.Word(),
@@ -0,0 +1,39 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Requests.FileSystemManagement.Thumbnails;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.FileSystemManagement.Thumbnails;
/// <summary>
/// Fixture class for generating <see cref="GetThumbnailRequest"/> test data.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetThumbnailRequestFixture
{
/// <summary>
/// Creates a new <see cref="GetThumbnailRequest"/> instance with randomized test data.
/// </summary>
/// <param name="path">Optional file system path of the file whose thumbnail is retrieved.</param>
/// <param name="quality">Optional quality used for the thumbnail.</param>
/// <returns>A configured <see cref="GetThumbnailRequest"/> instance.</returns>
public GetThumbnailRequest Create(string? path = null, int? quality = null)
{
return new GetThumbnailRequest(
Path: path ?? $"/media/{System.Guid.NewGuid():N}.png",
Quality: quality ?? 70
);
}
/// <summary>
/// Creates multiple <see cref="GetThumbnailRequest"/> instances with randomized test data.
/// </summary>
/// <param name="count">Number of instances to create.</param>
/// <returns>List of configured <see cref="GetThumbnailRequest"/> instances.</returns>
public List<GetThumbnailRequest> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}