Skip to content

Commit

Permalink
fix github comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLewis-digirati committed Oct 14, 2024
1 parent d79ef2d commit 6c354b8
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,24 @@ private static string ConvertToIIIFCollection(CreateCollection request, Collecti
{
var collectionAsIIIF = request.RawRequestBody.FromJson<IIIF.Presentation.V3.Collection>();
var convertedIIIFCollection = collectionAsIIIF.AsJson();
var thumbnails = collectionAsIIIF.Thumbnail?.Select(c => c as Image).ToList();
collection.Thumbnail = thumbnails!?.GetThumbnailPath();
var thumbnails = collectionAsIIIF.Thumbnail?.Where(CheckThumbnailIsImage).Select(c => (Image)c).ToList();
if (thumbnails != null)
{
collection.Thumbnail = thumbnails.GetThumbnailPath();
}
return convertedIIIFCollection;
}

private static bool CheckThumbnailIsImage(ExternalResource externalResource)
{
if (externalResource is Image)
{
return true;
}

return false;
}

private async Task UploadToS3IfRequiredAsync(CreateCollection request,
string id, string convertedIIIFCollection, CancellationToken cancellationToken)
{
Expand Down

0 comments on commit 6c354b8

Please sign in to comment.