Fix query and API bugs: 403 for non-owners, page bounds, lifecycle filters, cover fallback, race-safe inserts, async album delete
This commit is contained in:
@@ -15,7 +15,7 @@ public class StorageService(IDatabase database, IAmazonS3 amazonS3, ILogger<Stor
|
||||
InfrastructureStorageConfiguration storageClientConfiguration)
|
||||
: IStorageService
|
||||
{
|
||||
public async Task<Stream> GetFileAsync(string bucket, string key, CancellationToken cancellationToken)
|
||||
public async Task<Stream?> GetFileAsync(string bucket, string key, CancellationToken cancellationToken)
|
||||
{
|
||||
var request = new GetObjectRequest
|
||||
{
|
||||
@@ -29,6 +29,11 @@ public class StorageService(IDatabase database, IAmazonS3 amazonS3, ILogger<Stor
|
||||
logger.LogDebug("Retrieved file from S3 {Bucket}/{Key}", bucket, key);
|
||||
return response.ResponseStream;
|
||||
}
|
||||
catch (AmazonS3Exception exception) when (exception.ErrorCode == "NoSuchKey")
|
||||
{
|
||||
logger.LogDebug("File not found in S3 {Bucket}/{Key}", bucket, key);
|
||||
return null;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Failed to get file from S3 {Bucket}/{Key}", bucket, key);
|
||||
|
||||
Reference in New Issue
Block a user