Skip to content

Commit

Permalink
simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLewis-digirati committed Oct 14, 2024
1 parent 6c354b8 commit dc4bfe5
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,14 @@ private static string ConvertToIIIFCollection(CreateCollection request, Collecti
{
var collectionAsIIIF = request.RawRequestBody.FromJson<IIIF.Presentation.V3.Collection>();
var convertedIIIFCollection = collectionAsIIIF.AsJson();
var thumbnails = collectionAsIIIF.Thumbnail?.Where(CheckThumbnailIsImage).Select(c => (Image)c).ToList();
var thumbnails = collectionAsIIIF.Thumbnail?.Where(c => c is Image).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 dc4bfe5

Please sign in to comment.