Feature: Changed the time to display in H:MIN instead of only MIN. #149

Merged
CrissZollo merged 1 commit from feature-length-time into main 2025-09-30 13:11:18 +00:00

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>