Feature: Changed the time to display in H:MIN instead of only MIN. Runtimes less than 60 still shows only MIN

This commit is contained in:
CrissZollo 2025-09-28 22:38:13 +02:00
parent a877f5ac13
commit ebf2ea50ed

View file

@ -117,7 +117,15 @@ const MetadataDetails: React.FC<MetadataDetailsProps> = ({
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.year}</Text>
)}
{metadata.runtime && (
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.runtime}</Text>
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>
{(() => {
const r = parseInt(metadata.runtime, 10);
if (isNaN(r) || r < 60) return metadata.runtime;
const h = Math.floor(r / 60);
const m = r % 60;
return `${h}H ${m < 10 ? '0' : ''}${m}MIN`;
})()}
</Text>
)}
{metadata.certification && (
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.certification}</Text>