Adds an artwork_previews list column to a collections data.frame by fetching thumbnail URLs for each collection's most recent artworks.

add_artwork_previews_to_collections(collections, cn, limit = 4)

Arguments

collections

data.frame with collections data. Must contain columns: artist_uuid, collection_uuid

cn

Database connection object (from artcore::dbc())

limit

Integer(1). Maximum thumbnails per collection (default 4)

Value

The input data.frame with an added artwork_previews list column

Details

This is a convenience wrapper around get_collection_artwork_previews() that operates on a full collections data.frame. The artist_uuid from the first row is used for all collections (assumes single-artist context).

The artwork_previews column is a list column where each element is a character vector of thumbnail URLs.

Examples

if (FALSE) { # \dontrun{
cn <- artcore::dbc()
artist <- "123e4567-e89b-12d3-a456-426614174000"
collections <- artutils::get_artist_collections_summary(artist, cn)
collections <- add_artwork_previews_to_collections(collections, cn)
# Now collections$artwork_previews[[1]] contains URLs for first collection
} # }