mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
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:
parent
a877f5ac13
commit
ebf2ea50ed
1 changed files with 9 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue