fix: /nowplaying showing 'unavailable' views when track.views is set properly

This commit is contained in:
Marius Begby committed 2023-07-15 18:20:14 +02:00
1 parent 845002595f
commit c59fce19c7
1 file changed
+4 -1
+4 -1
View File
@@ -60,11 +60,13 @@ module.exports = {
]);
const currentTrack = queue.currentTrack;
let author = currentTrack.author ? currentTrack.author : 'Unavailable';
if (author === 'cdn.discordapp.com') {
author = 'Unavailable';
}
let plays = currentTrack.views !== 0 ? currentTrack.views : 0;
if (
plays === 0 &&
currentTrack.metadata.bridge &&
@@ -72,9 +74,10 @@ module.exports = {
currentTrack.metadata.bridge.views !== undefined
) {
plays = currentTrack.metadata.bridge.views;
} else {
} else if (plays === 0) {
plays = 'Unavailable';
}
const source =
sourceStringsFormatted.get(currentTrack.raw.source) ??
'Unavailable';