From 92281531729d05133b46685fc6316caad762eb72 Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Sun, 31 Jul 2022 11:08:39 +0100 Subject: [PATCH] Moved time conversion to built-in MK function --- src/renderer/main/vueapp.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index b055fc86..ff70b7a7 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1881,27 +1881,7 @@ const app = new Vue({ return dDisplay + (dDisplay && hDisplay ? ", " : "") + hDisplay + (hDisplay && mDisplay ? ", " : "") + mDisplay; } else { - let returnTime = datetime.toISOString().substring(11, 19); - - const timeGates = { - 600: 15, // 10 Minutes - 3600: 14, // Hour - 36000: 12, // 10 Hours - } - - for (let key in timeGates) { - if (seconds < key) { - returnTime = datetime.toISOString().substring(timeGates[key], 19) - break - } - } - - // Add the days on the front - if (seconds >= 86400) { - returnTime = parseInt(datetime.toISOString().substring(8, 10)) - 1 + ":" + returnTime - } - - return returnTime + return MusicKit.formatMediaTime(seconds); } }, hashCode(str) {