From 0611e0e1bb37d327b4901a42497bbb1ac2ef2bce Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 14 May 2020 12:11:04 +0200 Subject: [PATCH] Frontend: Show additional photo infos in card view Signed-off-by: Michael Mayer --- frontend/src/common/util.js | 28 +++++++++--------- frontend/src/component/p-photo-cards.vue | 2 +- frontend/src/model/photo.js | 37 ++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/frontend/src/common/util.js b/frontend/src/common/util.js index 980bbd6cf..9e7c2981a 100644 --- a/frontend/src/common/util.js +++ b/frontend/src/common/util.js @@ -1,9 +1,9 @@ -const Nanosecond = 1 -const Microsecond = 1000 * Nanosecond -const Millisecond = 1000 * Microsecond -const Second = 1000 * Millisecond -const Minute = 60 * Second -const Hour = 60 * Minute +const Nanosecond = 1; +const Microsecond = 1000 * Nanosecond; +const Millisecond = 1000 * Microsecond; +const Second = 1000 * Millisecond; +const Minute = 60 * Second; +const Hour = 60 * Minute; export default class Util { static duration(d) { @@ -12,7 +12,7 @@ export default class Util { let neg = d < 0; if (neg) { - u = -u + u = -u; } if (u < Second) { @@ -33,15 +33,15 @@ export default class Util { return Math.round(u / Millisecond) + "ms"; } - let result = [] + let result = []; - let h = Math.floor(u / Hour) - let min = Math.floor(u / Minute)%60 - let sec = Math.ceil(u / Second)%60 + let h = Math.floor(u / Hour); + let min = Math.floor(u / Minute)%60; + let sec = Math.ceil(u / Second)%60; - result.push(h.toString().padStart(2, '0')) - result.push(min.toString().padStart(2, '0')) - result.push(sec.toString().padStart(2, '0')) + result.push(h.toString().padStart(2, "0")); + result.push(min.toString().padStart(2, "0")); + result.push(sec.toString().padStart(2, "0")); // return `${h}h${min}m${sec}s` diff --git a/frontend/src/component/p-photo-cards.vue b/frontend/src/component/p-photo-cards.vue index c5f3b344c..aad8e7466 100644 --- a/frontend/src/component/p-photo-cards.vue +++ b/frontend/src/component/p-photo-cards.vue @@ -100,7 +100,7 @@