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,
|
2024-09-10 00:47:03 +00:00
|
|
|
hash: media.hash,
|
2024-06-01 22:30:56 +00:00
|
|
|
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-10-22 01:12:42 +00:00
|
|
|
sharpness: media.sharpness,
|
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
|
|
|
};
|
|
|
|
}
|