From 710db9c819337a02d88377cf4f66b9ed8e9b4e5a Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 11 Jan 2022 22:32:42 +0700 Subject: [PATCH] core why? --- src/main/lastfm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/lastfm.js b/src/main/lastfm.js index 2178645e..0c453797 100644 --- a/src/main/lastfm.js +++ b/src/main/lastfm.js @@ -61,7 +61,8 @@ const lfm = { }, scrobbleSong: async function (attributes) { - await new Promise(resolve => setTimeout(resolve, (attributes.durationInMillis / (app.cfg.get('lastfm.scrobble_after') / 100)))); + console.log((app.cfg.get('lastfm.scrobble_after') / 100)) + await new Promise(resolve => setTimeout(resolve, Math.round(attributes.durationInMillis * (app.cfg.get('lastfm.scrobble_after') / 100)))); const currentAttributes = app.media; if (!app.lastfm || app.lastfm.cachedAttributes === attributes ) {