fallback for broken assets

This commit is contained in:
Austin 2021-11-07 04:16:45 -05:00
parent 4973f1087f
commit 852741cb6e
1 changed files with 6 additions and 2 deletions

View File

@ -5110,18 +5110,22 @@ function getAssetRender($id)
if ($assetinfo->AssetTypeId == 1 || $assetinfo->AssetTypeId == 22) //images and group emblems if ($assetinfo->AssetTypeId == 1 || $assetinfo->AssetTypeId == 22) //images and group emblems
{ {
$assethash = $assetinfo->Hash; $assethash = $assetinfo->Hash;
if (file_exists($GLOBALS['thumbnailCDNPath'].$assethash)) {
return constructThumbnailHashUrl($assethash); return constructThumbnailHashUrl($assethash);
} }
}
else //default to grab the assets ThumbHash else //default to grab the assets ThumbHash
{ {
if (!empty($assetinfo->ThumbHash)) //if a render was ever performed if (!empty($assetinfo->ThumbHash)) //if a render was ever performed
{ {
$thumbhash = $assetinfo->ThumbHash; $thumbhash = $assetinfo->ThumbHash;
if (file_exists($GLOBALS['renderCDNPath'].$thumbhash)) {
return constructRenderHashUrl($thumbhash); return constructRenderHashUrl($thumbhash);
} }
} }
} }
} }
}
return getImageFromAsset(126); //126 is default image asset id return getImageFromAsset(126); //126 is default image asset id
} }