mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
filter workss
This commit is contained in:
1 parent
0bdc37fa73
commit
2f0cdc6b9a
2 files changed
+10
-4
No files matched your search
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
"genius-lyrics": "^4.4.3",
|
"genius-lyrics": "^4.4.3",
|
||||||
"moonlink.js": "^5.2.0",
|
"moonlink.js": "^5.2.0",
|
||||||
"mysql": "^2.18.1",
|
"mysql": "^2.18.1",
|
||||||
"revoice.js": "^0.2.1694",
|
"revoice.js": "^0.2.1696",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"ws": "^8.19.0"
|
"ws": "^8.19.0"
|
||||||
},
|
},
|
||||||
|
|||||||
+9
-3
@@ -612,8 +612,8 @@ export default class Player extends EventEmitter {
|
|||||||
const entries = Array.isArray(voiceStates)
|
const entries = Array.isArray(voiceStates)
|
||||||
? voiceStates
|
? voiceStates
|
||||||
: typeof voiceStates.values === "function"
|
: typeof voiceStates.values === "function"
|
||||||
? voiceStates.values()
|
? voiceStates.values()
|
||||||
: Object.values(voiceStates);
|
: Object.values(voiceStates);
|
||||||
for (const state of entries) {
|
for (const state of entries) {
|
||||||
const stateChannelId = String(state?.channelId ?? state?.channel_id ?? "").replace(/\D/g, "");
|
const stateChannelId = String(state?.channelId ?? state?.channel_id ?? "").replace(/\D/g, "");
|
||||||
if (stateChannelId === cleanChan) {
|
if (stateChannelId === cleanChan) {
|
||||||
@@ -1480,7 +1480,13 @@ export default class Player extends EventEmitter {
|
|||||||
// Restart the current stream so the loadstream URL picks up the new filters.
|
// Restart the current stream so the loadstream URL picks up the new filters.
|
||||||
// The PATCH only updates NodeLink's player state — it does NOT modify the
|
// The PATCH only updates NodeLink's player state — it does NOT modify the
|
||||||
// currently-streaming PCM pipe. Without restarting, the audio won't change.
|
// currently-streaming PCM pipe. Without restarting, the audio won't change.
|
||||||
if (current?.encoded && this.connection && !this.leaving && !this._streamingStopped) {
|
//
|
||||||
|
// Guard: only restart if we're mid-playback (startedPlaying is set) AND
|
||||||
|
// _doPlayNext is NOT in progress. When _doPlayNext calls applyFilter()
|
||||||
|
// before starting a new track, startedPlaying hasn't been set yet and
|
||||||
|
// _doPlayNext itself handles the stream — firing _replayWithFilters here
|
||||||
|
// would cause the same song to play twice simultaneously.
|
||||||
|
if (current?.encoded && this.connection && !this.leaving && !this._streamingStopped && this.startedPlaying && !this._playingNext) {
|
||||||
const elapsed = this.startedPlaying ? (Date.now() - this.startedPlaying) : 0;
|
const elapsed = this.startedPlaying ? (Date.now() - this.startedPlaying) : 0;
|
||||||
const positionMs = Math.max(0, elapsed);
|
const positionMs = Math.max(0, elapsed);
|
||||||
logger.player(`[Player] Filter applied — restarting stream from ${positionMs}ms`);
|
logger.player(`[Player] Filter applied — restarting stream from ${positionMs}ms`);
|
||||||
|
|||||||
Reference in new issue
Block a user