in Application/UI/mvc-frontend/ImageRecognition/ImageRecognitionManager.cs [112:145]
public async Task<Album> GetAlbumDetails(string userId, string albumId)
{
var albumQuery =
_ddbContext.QueryAsync<Album>(userId, QueryOperator.Equal, new[] {albumId});
var albums = await albumQuery.GetRemainingAsync().ConfigureAwait(false);
var album = albums.FirstOrDefault();
if (album != null)
{
var photoQuery = _ddbContext.QueryAsync<Photo>(albumId,
new DynamoDBOperationConfig {IndexName = "albumID-uploadTime-index"});
album.Photos = await photoQuery.GetRemainingAsync().ConfigureAwait(false);
foreach (var photo in album.Photos)
if (photo.ProcessingStatus == ProcessingStatus.Succeeded)
{
photo.Thumbnail.Url = _s3Client.GetPreSignedURL(new GetPreSignedUrlRequest
{
BucketName = _appOptions.PhotoStorageBucket,
Key = $"private/resized/{userId}/{photo.PhotoId}",
Expires = DateTime.UtcNow.AddHours(1)
});
photo.FullSize.Url = _s3Client.GetPreSignedURL(new GetPreSignedUrlRequest
{
BucketName = _appOptions.PhotoStorageBucket,
Key = $"private/uploads/{userId}/{photo.PhotoId}",
Expires = DateTime.UtcNow.AddHours(1)
});
}
}
return album;
}