OverleapTechnologies / LavaJS

A lightweight and Dynamic LavaLink wrapper for Discord bots. Playing music has never been easier!
https://ratulsaha.me
MIT License
14 stars 7 forks source link

Recommendation + Features #11

Closed LegendNed closed 4 years ago

LegendNed commented 4 years ago

Recommendation: Make the EQBands an array-based system instead of doing each individually. This will make it easier adding multiple bands at a time. For example: [ { band: 0, gain: 1 }, { band: 1, gain: 1 } ]

Issue: Converting a lavalink track array to playlist fails to generate thumbnails for Soundcloud resulting in: https://img.youtube.com/vi/O:https://api-v2.soundcloud.com/media/soundcloud:tracks:439450881/afb1cd77-3e28-4d19-8eea-cea2da89eca2/stream/hls/maxresdefault.jpg

Code:

let playlist = await bot.player.getSongs(bot, track)
playlist = bot.player.Utils.newPlaylist({
    name: "Generated Playlist",
    trackCount: playlist.length,
    duration: playlist.reduce((a, b) => a + b.info.length, 0),
    tracks: playlist
}, message.author)
player.queue.add(playlist.tracks)
if (!player.playState) player.play()

Issue: Skipping songs plays the song. Methods attempted to skip player.stop() and player.play() Queue:

Queue [Map] {
  2 => [Object],
  3 => [Object],
  4 => [Object],
  5 => [Object],
  6 => [Object],
  7 => [Object],
  8 => [Object],
  9 => [Object],
  10 => [Object],
  11 => [Object],
  12 => [Object],
  13 => [Object],
  14 => [Object],
  15 => [Object],
  16 => [Object],
  17 => [Object],
  18 => [Object],
  19 => [Object],
  20 => [Object],
  21 => [Object],
  22 => [Object],
  23 => [Object],
  24 => [Object],
  25 => [Object],
  player: [Player]
}

Loops the second (2) if skipping is attempted. At player.js line 194 the topmost song is never removed from my understanding.

Contact me via Discord Ned#1270 or email ned@dustie.xyz for faster replies

ThatAnonyG commented 4 years ago

@LegendNed Hello! We will release the Array system for Bands in the next release. As for the skipping song issue, can you tell me if you enabled player.trackRepeat? If you are unsure can you send me the code where you actually spawn the player? Cause it seems like Player#trackRepeat is enabled. Also the thumbnail issue for soundcloud will be fixed asap. Till then this thread is open for discussion.

LegendNed commented 4 years ago

@ThatAnonymousG I do not have trackRepeat on, it successfully skips the first song and it fails afterwards. Code:

        if (!bot.player.get(message.guild.id)) bot.player.spawn({
            guild: message.guild,
            voiceChannel: message.member.voice.channel,
            textChannel: message.channel,
            deafen: true,
            trackRepeat: false,
            queueRepeat: false,
            skinOnError: true
        })
ThatAnonyG commented 4 years ago

I see. Can you give me the code where you skip the songs? Cause I have tested this a lot of times and it never failed. @LegendNed

ThatAnonyG commented 4 years ago

Just confirmed the skipping bug. Fixing it asap. Thanks for reporting.

ThatAnonyG commented 4 years ago

Version 3.3.0 has been released and that should fix all the above requests. As of the thumbnail issue please note that the thumbnails only work if you are using YouTube as data source because other sources require an API key. So if you are using something like SoundCloud please use their API to get a thumbnail link.

Please check the latest changelog here.