Missing if
This commit is contained in:
@@ -5,10 +5,11 @@ using Ardalis.Result;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Musify.Application.Contracts.Infrastructure;
|
using Musify.Application.Contracts.Infrastructure;
|
||||||
using Musify.Domain.Entities;
|
using Musify.Domain.Entities;
|
||||||
|
using Musify.Infrastructure.Configuration;
|
||||||
|
|
||||||
namespace Musify.Infrastructure.Storage
|
namespace Musify.Infrastructure.Storage
|
||||||
{
|
{
|
||||||
public class StorageHandler(IDatabase database, IAmazonS3 amazonS3, ILogger<StorageHandler> logger)
|
public class StorageHandler(IDatabase database, IAmazonS3 amazonS3, StorageClientConfiguration storageClientConfiguration, ILogger<StorageHandler> logger)
|
||||||
: IStorageHandler
|
: IStorageHandler
|
||||||
{
|
{
|
||||||
public async Task<Result<Stream>> GetFileAsync(string bucketName, string keyName, CancellationToken cancellationToken)
|
public async Task<Result<Stream>> GetFileAsync(string bucketName, string keyName, CancellationToken cancellationToken)
|
||||||
@@ -42,7 +43,7 @@ namespace Musify.Infrastructure.Storage
|
|||||||
BucketName = bucketName,
|
BucketName = bucketName,
|
||||||
Key = keyName,
|
Key = keyName,
|
||||||
Expires = DateTime.UtcNow + expirationTime,
|
Expires = DateTime.UtcNow + expirationTime,
|
||||||
Protocol = Protocol.HTTP
|
Protocol = storageClientConfiguration.UseHttp ? Protocol.HTTP : Protocol.HTTPS
|
||||||
};
|
};
|
||||||
|
|
||||||
logger.LogDebug("Getting pre-signed URL from S3 with bucket name {BucketName} and key name {KeyName}", bucketName, keyName);
|
logger.LogDebug("Getting pre-signed URL from S3 with bucket name {BucketName} and key name {KeyName}", bucketName, keyName);
|
||||||
|
|||||||
Reference in New Issue
Block a user