Skip to content

Commit

Permalink
better progress tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
coopw1 committed Jan 22, 2024
1 parent cc6a047 commit dda0f93
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/commands/general/util/getAllListens.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = async (
listenBrainzToken,
brainzUsername
);
if (totalScrobbles < maxCount) {
maxCount = totalScrobbles;
}

const BASE_URL = `https://api.listenbrainz.org/1/user/${brainzUsername}/listens`;
const AUTH_HEADER = {
Expand Down Expand Up @@ -78,9 +81,10 @@ module.exports = async (
lastResponseCount = response.data.payload.count;

interaction.editReply({
content: `Retrieved ${responses.count}/${totalScrobbles} listens. (${
(responses.count / totalScrobbles) * 100
}%)`,
content: `Retrieved ${responses.count}/${maxCount} listens. (${(
(responses.count / maxCount) *
100
).toFixed(2)}%)`,
});
}

Expand Down

0 comments on commit dda0f93

Please sign in to comment.