diff options
| author | Max Isom <[email protected]> | 2020-03-25 17:59:09 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2020-03-25 17:59:09 -0500 |
| commit | 4e1a156f9be48eaefbd3f6dc09f302db7deaddb2 (patch) | |
| tree | bd10d224834684b242aefd87a475241d09e3b324 /src/services/player.ts | |
| parent | dc70a37e962d39ddc5781525d3178e5d9ebe6861 (diff) | |
| download | muse-4e1a156f9be48eaefbd3f6dc09f302db7deaddb2.tar.xz muse-4e1a156f9be48eaefbd3f6dc09f302db7deaddb2.zip | |
Bump dependencies
Diffstat (limited to 'src/services/player.ts')
| -rw-r--r-- | src/services/player.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/services/player.ts b/src/services/player.ts index ad25744..074fe5d 100644 --- a/src/services/player.ts +++ b/src/services/player.ts @@ -238,7 +238,9 @@ export default class { } shuffle(): void { - this.queue = [...this.queue.slice(0, this.queuePosition + 1), ...shuffle(this.queue.slice(this.queuePosition + 1))]; + const shuffledSongs = shuffle(this.queue.slice(this.queuePosition + 1)); + + this.queue = [...this.queue.slice(0, this.queuePosition + 1), ...shuffledSongs]; } clear(): void { @@ -306,7 +308,7 @@ export default class { const nextBestFormat = (formats: ytdl.videoFormat[]): ytdl.videoFormat | undefined => { if (formats[0].live) { - formats = formats.sort((a, b) => (b as any).audioBitrate - (a as any).audioBitrate); // Bad typings + formats = formats.sort((a, b) => (b as unknown as {audioBitrate: number}).audioBitrate - (a as unknown as {audioBitrate: number}).audioBitrate); // Bad typings return formats.find(format => [128, 127, 120, 96, 95, 94, 93].includes(parseInt(format.itag as unknown as string, 10))); // Bad typings } |
