fail media for the moment

This commit is contained in:
smolgrrr 2024-09-07 14:06:18 +10:00
parent baa320b795
commit 3895404360

View File

@ -87,16 +87,16 @@ const RenderMedia = ({ files }: { files: string[] }) => {
// Check for both NSFW and gore content // Check for both NSFW and gore content
if (mediaCheckResult && (mediaCheckResult.nsfwLabel !== 'neutral')) { if (mediaCheckResult && (mediaCheckResult.nsfwLabel !== 'neutral')) {
return ( return (
<div> <div key={file}>
<p className="text-center text-red-500 text-xs">This Wired instance blocks NSFW media.</p> <p className="text-center text-red-500 text-xs">This Wired instance blocks NSFW media.</p>
</div> </div>
); );
} }
if (file && (file.endsWith(".mp4") || file.endsWith(".webm")) && mediaCheckResult && mediaCheckResult.nsfwLabel === 'neutral') { if (file && (file.endsWith(".mp4") || file.endsWith(".webm")) && mediaCheckResult && mediaCheckResult.nsfwLabel === 'fail') {
return ( return (
<video <video
key={index} key={file}
controls controls
muted muted
src={file + "#t=0.1"} src={file + "#t=0.1"}
@ -106,10 +106,10 @@ const RenderMedia = ({ files }: { files: string[] }) => {
<source src={file} type="video/mp4" /> <source src={file} type="video/mp4" />
</video> </video>
); );
} else if (file && mediaCheckResult && mediaCheckResult.nsfwLabel === 'neutral') { } else if (file && mediaCheckResult && mediaCheckResult.nsfwLabel === 'fail') {
return ( return (
<img <img
key={index} key={file}
alt="Invalid thread" alt="Invalid thread"
loading="lazy" loading="lazy"
className={`thumb mt-2 max-h-64 mx-auto rounded-md`} className={`thumb mt-2 max-h-64 mx-auto rounded-md`}
@ -119,7 +119,7 @@ const RenderMedia = ({ files }: { files: string[] }) => {
); );
} else { } else {
return ( return (
<div> <div key={file}>
<p className="text-center text-white-500 text-xs">Checking media...</p> <p className="text-center text-white-500 text-xs">Checking media...</p>
</div> </div>
); );