From e685b4c0453de0c7c7623a84d2c3628aa3bcf2ca Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Thu, 4 Jun 2026 01:37:00 -0500 Subject: [PATCH] Use default storage location if none specified --- LANCommander.SDK/Helpers/ApiRequestBuilder.cs | 1 + LANCommander.Server/Endpoints/UploadEndpoints.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/LANCommander.SDK/Helpers/ApiRequestBuilder.cs b/LANCommander.SDK/Helpers/ApiRequestBuilder.cs index 704f1e2c..4d429403 100644 --- a/LANCommander.SDK/Helpers/ApiRequestBuilder.cs +++ b/LANCommander.SDK/Helpers/ApiRequestBuilder.cs @@ -293,6 +293,7 @@ public class ApiRequestBuilder( .UseVersioning() .UseAuthenticationToken() .UseCancellationToken(_cancellationToken) + .AddBody(new UploadInitRequest()) .PostAsync(); if (initResponse == null || initResponse.Key == Guid.Empty) diff --git a/LANCommander.Server/Endpoints/UploadEndpoints.cs b/LANCommander.Server/Endpoints/UploadEndpoints.cs index abcf7032..f3a553e9 100644 --- a/LANCommander.Server/Endpoints/UploadEndpoints.cs +++ b/LANCommander.Server/Endpoints/UploadEndpoints.cs @@ -17,13 +17,15 @@ public static class UploadEndpoints } internal static async Task InitAsync( - SDK.Models.UploadInitRequest request, + SDK.Models.UploadInitRequest? request, [FromServices] StorageLocationService storageLocationService, [FromServices] ArchiveService archiveService, [FromServices] IFusionCache cache) { + var storageLocationId = request?.StorageLocationId; + var storageLocation = await storageLocationService.GetOrDefaultAsync( - request.StorageLocationId == Guid.Empty ? null : request.StorageLocationId, + storageLocationId == null || storageLocationId == Guid.Empty ? null : storageLocationId, SDK.Enums.StorageLocationType.Archive); if (!Directory.Exists(storageLocation.Path))