2024-08-28 23:53:26 +00:00
|
|
|
export function curateMedia(media, context = {}) {
|
2024-06-01 22:30:56 +00:00
|
|
|
if (!media) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
id: media.id,
|
|
|
|
path: media.path,
|
|
|
|
thumbnail: media.thumbnail,
|
|
|
|
lazy: media.lazy,
|
|
|
|
isS3: media.is_s3,
|
|
|
|
width: media.width,
|
|
|
|
height: media.height,
|
2024-06-07 03:20:13 +00:00
|
|
|
index: media.index,
|
2024-06-12 01:28:40 +00:00
|
|
|
credit: media.credit,
|
2024-08-28 23:53:26 +00:00
|
|
|
type: context.type || null,
|
2024-06-01 22:30:56 +00:00
|
|
|
};
|
|
|
|
}
|