thumbnail support

This commit is contained in:
2023-07-27 14:36:46 +10:00
parent 0c4c36eb74
commit dd8e59cd4f
6 changed files with 159 additions and 24 deletions

View File

@@ -37,3 +37,15 @@ export const mimeMatches = (
return regex.test(mimeToCheck);
};
export const mediaGetThumbnail = (media: Media): string => {
if (!media) {
return "";
}
if (media.thumbnail && media.thumbnail.length > 0) {
return media.thumbnail;
}
return mediaGetVariantUrl(media, "thumb");
};