mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
bye
This commit is contained in:
1 parent
35aab94a53
commit
3ef54117bb
27 files changed
+5
-156
No files matched your search
@@ -309,7 +309,6 @@ const PlaybackMixin = {
|
||||
if (result === "finished" && !this._skipping && !this.leaving && !this._paused) {
|
||||
this._handleTrackEnd();
|
||||
} else if (result === "stopped") {
|
||||
// Stopped intentionally (skip/seek/stop) — nothing to do.
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -339,20 +339,12 @@ class Player extends EventEmitter {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1) Detach from playerMap (active + home keys) so rejoin paths no
|
||||
// longer see a "player already here" and skip.
|
||||
detachPlayerFromManager(ctx, this, channelId);
|
||||
|
||||
// 2) Arm the ctx-level rejoin BEFORE destroying ourselves — the timer
|
||||
// must outlive this instance.
|
||||
ctx.schedule247Rejoin(channelId, guildId);
|
||||
|
||||
// 3) Notify (dashboard close/stopplay); the manager-level autoleave
|
||||
// listeners suppress the actual leave for 24/7 channels, so this is
|
||||
// notification-only.
|
||||
this.emit("autoleave");
|
||||
|
||||
// 4) Finally destroy the dead instance.
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
@@ -510,14 +502,6 @@ class Player extends EventEmitter {
|
||||
this._assertSelfDeaf(vm, channelId);
|
||||
|
||||
if (typeof voiceConn.on === "function") {
|
||||
// Self-deaf keeper: Fluxer's VoiceManager answers every
|
||||
// requestVoiceStateSync event (emitted by conn.stop()/stopVideo(),
|
||||
// which the audio bridge triggers on EVERY play() and stop()) with a
|
||||
// gateway VoiceStateUpdate that resets self_deaf to false — silently
|
||||
// un-deafening the bot the moment the first track starts and again on
|
||||
// every skip/stop/track-end. The manager registers its own sync
|
||||
// listener inside registerConnection() (before join() resolved), so
|
||||
// this listener runs AFTER it and our re-deafen state update wins.
|
||||
voiceConn.on("requestVoiceStateSync", () => {
|
||||
if (this.leaving || this._destroyed) return;
|
||||
this._assertSelfDeaf(vm, channelId);
|
||||
@@ -536,11 +520,6 @@ class Player extends EventEmitter {
|
||||
const gId = cleanId(this._guildId ?? "");
|
||||
|
||||
if (mode === "on" && cId && gId) {
|
||||
// 24/7: the voice session is gone but the commitment stands.
|
||||
// Detach this now-dead player (a zombie in the map makes every
|
||||
// rejoin path bail with "already has a player"), arm a
|
||||
// bot-level rejoin that survives our own destroy, notify, then
|
||||
// destroy ourselves.
|
||||
logger.player("[Player] serverLeave in 24/7 mode — detaching and scheduling rejoin");
|
||||
this._detachAndSchedule247Rejoin(cId, gId);
|
||||
} else {
|
||||
@@ -981,8 +960,6 @@ class Player extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
// Attach the split-out concerns: playback advancement (PlaybackMixin), search
|
||||
// & queue-filling (SearchMixin), and user-facing rendering (DisplayMixin).
|
||||
applyMixins(Player, PlaybackMixin, SearchMixin, DisplayMixin);
|
||||
|
||||
export { Player as default, Player, Queue };
|
||||
@@ -229,11 +229,6 @@ const SearchMixin = {
|
||||
if (!isUrl) throw searchErr;
|
||||
}
|
||||
let lcTracks = result?.tracks ?? [];
|
||||
// Set when the only results we have came from the oEmbed title-search
|
||||
// fallback. That path resolves a SINGLE video (direct URL load was
|
||||
// bot-blocked), so its result list is a search page — NOT a playlist.
|
||||
// Bulk-queueing it would queue a bunch of "related" songs instead of
|
||||
// the one requested video (original fluxer bug reported by users).
|
||||
let fromTitleFallback = false;
|
||||
|
||||
if (isUrl && lcTracks.length === 0 && ytId) {
|
||||
@@ -288,9 +283,6 @@ const SearchMixin = {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pick the track to queue. For a title-search fallback, prefer the
|
||||
// result that is the exact video the user requested (search may rank
|
||||
// covers/remixes first); otherwise take the first result.
|
||||
let firstTrack = lcTracks[0];
|
||||
if (fromTitleFallback && ytId) {
|
||||
firstTrack = lcTracks.find(t => (t?.info?.identifier ?? t?.identifier) === ytId) ?? lcTracks[0];
|
||||
@@ -299,8 +291,6 @@ const SearchMixin = {
|
||||
}
|
||||
}
|
||||
|
||||
// Only a genuine playlist/mix URL load may bulk-queue. A title-search
|
||||
// fallback for a single video must queue exactly one track.
|
||||
if (isUrl && !fromTitleFallback && lcTracks.length > 1) {
|
||||
const videos = lcTracks.map(t => this._lcTrackToVideo(t, trackMeta)).filter(Boolean);
|
||||
this.addManyToQueue(videos, top);
|
||||
|
||||
Reference in new issue
Block a user