mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fixed
This commit is contained in:
1 parent
092dbc15a1
commit
299ee6e692
2 files changed
+25
-24
No files matched your search
+25
-22
@@ -1475,17 +1475,8 @@ export default class Player extends EventEmitter {
|
||||
this._skipping = true;
|
||||
this._radioAnnounced = false;
|
||||
this.queue.current = null;
|
||||
this._stopMediaPlayer().then(() => {
|
||||
this._playingNext = false;
|
||||
if (!this.queue.isEmpty() && !this.leaving) {
|
||||
this.playNext();
|
||||
} else {
|
||||
this.emit("stopplay");
|
||||
if (!this._is247Enabled()) {
|
||||
this._startInactivityTimer();
|
||||
}
|
||||
// Send queue-end message when skipping the last track
|
||||
if (!this._wasRadio && !this._queueEndedSent) {
|
||||
|
||||
if (this.queue.isEmpty() && !this._wasRadio && !this._queueEndedSent) {
|
||||
this._queueEndedSent = true;
|
||||
const prefix = (() => {
|
||||
try {
|
||||
@@ -1496,6 +1487,16 @@ export default class Player extends EventEmitter {
|
||||
})();
|
||||
this.emit("message", { ...mkEmbed(this._t("responses._common.queueEnded", { prefix })), system: true });
|
||||
}
|
||||
|
||||
this._stopMediaPlayer().then(() => {
|
||||
this._playingNext = false;
|
||||
if (!this.queue.isEmpty() && !this.leaving) {
|
||||
this.playNext();
|
||||
} else {
|
||||
this.emit("stopplay");
|
||||
if (!this._is247Enabled()) {
|
||||
this._startInactivityTimer();
|
||||
}
|
||||
}
|
||||
}).catch(e => logger.error("[Player] skip stop error:", e.message))
|
||||
.finally(() => {
|
||||
@@ -1513,17 +1514,9 @@ export default class Player extends EventEmitter {
|
||||
this.queue.data.splice(0, idx);
|
||||
this.queue.current = null;
|
||||
this._skipping = true;
|
||||
this._stopMediaPlayer().then(() => {
|
||||
this._playingNext = false;
|
||||
if (!this.queue.isEmpty() && !this.leaving) {
|
||||
this.playNext();
|
||||
} else {
|
||||
this.emit("stopplay");
|
||||
if (!this._is247Enabled()) {
|
||||
this._startInactivityTimer();
|
||||
}
|
||||
// Send queue-end message when skipping to a position beyond remaining tracks
|
||||
if (!this._wasRadio && !this._queueEndedSent) {
|
||||
|
||||
// If the queue is now empty after splicing, send queue-end immediately.
|
||||
if (this.queue.isEmpty() && !this._wasRadio && !this._queueEndedSent) {
|
||||
this._queueEndedSent = true;
|
||||
const prefix = (() => {
|
||||
try {
|
||||
@@ -1534,6 +1527,16 @@ export default class Player extends EventEmitter {
|
||||
})();
|
||||
this.emit("message", { ...mkEmbed(this._t("responses._common.queueEnded", { prefix })), system: true });
|
||||
}
|
||||
|
||||
this._stopMediaPlayer().then(() => {
|
||||
this._playingNext = false;
|
||||
if (!this.queue.isEmpty() && !this.leaving) {
|
||||
this.playNext();
|
||||
} else {
|
||||
this.emit("stopplay");
|
||||
if (!this._is247Enabled()) {
|
||||
this._startInactivityTimer();
|
||||
}
|
||||
}
|
||||
}).catch(e => logger.error("[Player] skipTo stop error:", e.message))
|
||||
.finally(() => {
|
||||
|
||||
@@ -971,12 +971,10 @@ export class PlayerManager {
|
||||
let ch = player.textChannel;
|
||||
const guildId = cleanId(player._guildId ?? ch?.guildId ?? ch?.guild?.id ?? getMessageGuildId({ channel: ch }));
|
||||
|
||||
if (!m?.system) {
|
||||
const raw = this.settings.getServer(guildId)?.get("songAnnouncements");
|
||||
const disabled = raw === false || raw === 0 ||
|
||||
["false","0","no","off","disable"].includes(String(raw).toLowerCase().trim());
|
||||
if (disabled) return;
|
||||
}
|
||||
|
||||
// If textChannel is not set (e.g. after reboot recovery via _spawnPlayer),
|
||||
// resolve it from the saved announcementChannelId or guild channels
|
||||
|
||||
Reference in new issue
Block a user