aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/shared/video/video.model.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index 8e46ce44b..50ca9eb99 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -42,12 +42,16 @@ export class Video implements VideoServerModel {
42 } 42 }
43 43
44 private static createDurationString (duration: number) { 44 private static createDurationString (duration: number) {
45 const minutes = Math.floor(duration / 60) 45 const hours = Math.floor(duration / 3600)
46 const minutes = Math.floor(duration % 3600 / 60)
46 const seconds = duration % 60 47 const seconds = duration % 60
48
47 const minutesPadding = minutes >= 10 ? '' : '0' 49 const minutesPadding = minutes >= 10 ? '' : '0'
48 const secondsPadding = seconds >= 10 ? '' : '0' 50 const secondsPadding = seconds >= 10 ? '' : '0'
51 const displayedHours = hours > 0 ? hours.toString() + ':' : ''
49 52
50 return minutesPadding + minutes.toString() + ':' + secondsPadding + seconds.toString() 53 return displayedHours + minutesPadding +
54 minutes.toString() + ':' + secondsPadding + seconds.toString()
51 } 55 }
52 56
53 constructor (hash: VideoServerModel) { 57 constructor (hash: VideoServerModel) {