1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Changed calculation for media info run time to render hours when greater than 59 minutes

This commit is contained in:
Brian Arnold 2021-03-31 02:35:21 -04:00
parent 1c7ce790dc
commit 842fb086b9

View file

@ -257,11 +257,19 @@ import '../../elements/emby-button/emby-button';
if (item.Type === 'Audio') {
miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks));
} else {
minutes = item.RunTimeTicks / 600000000;
minutes = minutes || 1;
miscInfo.push(`${Math.round(minutes)} mins`);
const ticksPerMinute = 600000000;
let totalMinutes = Math.floor(ticks/ticksPerMinute);
totalMinutes = totalMinutes || 1;
let totalHours = Math.floor(totalMinutes / 60);
let remainderMinutes = totalMinutes % 60;
result = [];
if (totalHours > 0) {
result.push(`${totalHours} hrs`);
}
if (totalMinutes > 0) {
result.push(`${remainderMinutes} mins`);
}
miscInfo.push(result.join(', '));
}
}