mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
fix: /nowplaying showing 'unavailable' views when track.views is set properly
This commit is contained in:
1 parent
845002595f
commit
c59fce19c7
1 file changed
+4
-1
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user