Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Distube's ytdl-core fork (resolves playback issue) #1042

Merged
merged 7 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Fixed
- Fixed playback issue
- Audioplayer not stopping properly

## [2.8.1] - 2024-04-28
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.7.0-slim AS base
FROM node:18-bullseye-slim AS base

# openssl will be a required package if base is updated to 18.16+ due to node:*-slim base distro change
# https://github.com/prisma/prisma/issues/19729#issuecomment-1591270599
Expand All @@ -19,7 +19,6 @@ FROM base AS dependencies
WORKDIR /usr/app

COPY package.json .
COPY patches ./patches
COPY yarn.lock .

RUN yarn install --prod
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ services:
### Node.js

**Prerequisites**:
* Node.js (16.x is recommended because it's the current LTS version)
* Node.js (18.17.0 or later is required and latest 18.x.x LTS is recommended)
* ffmpeg (4.1 or later)

1. `git clone https://github.com/codetheweb/muse.git && cd muse`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"types": "dts/types",
"type": "module",
"engines": {
"node": ">=16.0.0"
"node": ">=18.17.0"
},
"files": [
"src"
Expand Down Expand Up @@ -89,6 +89,7 @@
"@discordjs/opus": "^0.8.0",
"@discordjs/rest": "1.0.1",
"@discordjs/voice": "0.11.0",
"@distube/ytdl-core": "^4.13.5",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could fix current bug in bot

"@prisma/client": "4.16.0",
"@types/libsodium-wrappers": "^0.7.9",
"array-shuffle": "^3.0.0",
Expand Down Expand Up @@ -126,7 +127,6 @@
"sync-fetch": "^0.3.1",
"tsx": "3.8.2",
"xbytes": "^1.7.0",
"ytdl-core": "^4.11.5",
"ytsr": "^3.8.4"
},
"resolutions": {
Expand Down
172 changes: 0 additions & 172 deletions patches/ytdl-core+4.11.5.patch

This file was deleted.

4 changes: 2 additions & 2 deletions src/services/player.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {VoiceChannel, Snowflake} from 'discord.js';
import {Readable} from 'stream';
import hasha from 'hasha';
import ytdl, {videoFormat} from 'ytdl-core';
import ytdl, {videoFormat} from '@distube/ytdl-core';
import {WriteStream} from 'fs-capacitor';
import ffmpeg from 'fluent-ffmpeg';
import shuffle from 'array-shuffle';
Expand Down Expand Up @@ -280,8 +280,8 @@ export default class {
if (this.getCurrent() && this.status !== STATUS.PAUSED) {
await this.play();
} else {
this.audioPlayer?.stop(true);
this.status = STATUS.IDLE;
this.audioPlayer?.stop(true);

const settings = await getGuildSettings(this.guildId);

Expand Down
Loading
Loading