mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
HOTFIX
This commit is contained in:
1 parent
068bb02bdb
commit
b4bb6c26e5
2 files changed
+19
-7
No files matched your search
@@ -497,11 +497,13 @@ const BotVoiceMixin = {
|
||||
system: true,
|
||||
});
|
||||
|
||||
await player.playNext();
|
||||
|
||||
if (current && pos > 0 && dur > 0) {
|
||||
await new Promise((r) => setTimeout(r, 800)); // let the bridge settle
|
||||
try { await player.seekToPosition(pos); } catch (_) {}
|
||||
if (current && pos > 0 && dur > 0) player._resumeSeekMs = pos;
|
||||
if (!player.queue.getCurrent()) {
|
||||
player.playNext().catch((e) => logger.warn(`[Restore] playNext failed for guild ${guildId}:`, e?.message ?? e));
|
||||
} else if (player._resumeSeekMs > 0) {
|
||||
const seekTo = player._resumeSeekMs;
|
||||
player._resumeSeekMs = 0;
|
||||
setTimeout(() => { player.seekToPosition(seekTo).catch(() => {}); }, 800).unref?.();
|
||||
}
|
||||
|
||||
logger.player(`[Restore] Guild ${guildId}: ${player.queue.data.length} track(s) restored, resuming at ${pos}ms.`);
|
||||
|
||||
@@ -175,7 +175,12 @@ const PlaybackMixin = {
|
||||
this._radioReconnects = 0;
|
||||
|
||||
if (songData.type !== "radio" || !this._radioAnnounced) {
|
||||
this.announceSong(songData);
|
||||
const now = Date.now();
|
||||
const last = this._lastAnnounce;
|
||||
const dup = last && !this.queue.songLoop && last.key === (songData.url || songData.title) && now - last.at < 8_000;
|
||||
if (!dup) this.announceSong(songData);
|
||||
else logger.player(`[Player:${this._guildId}] Suppressed duplicate now-playing for: ${songData.title}`);
|
||||
this._lastAnnounce = { key: songData.url || songData.title, at: now };
|
||||
if (songData.type === "radio") this._radioAnnounced = true;
|
||||
}
|
||||
this._skipVotes.clear();
|
||||
@@ -183,7 +188,12 @@ const PlaybackMixin = {
|
||||
|
||||
try {
|
||||
const playUri = songData.url;
|
||||
const seekSec = trackOptMatch?.startMs > 0 ? trackOptMatch.startMs / 1000 : 0;
|
||||
const resumeMs = this._resumeSeekMs > 0 ? this._resumeSeekMs : 0;
|
||||
this._resumeSeekMs = 0;
|
||||
const seekSec = resumeMs > 0
|
||||
? resumeMs / 1000
|
||||
: (trackOptMatch?.startMs > 0 ? trackOptMatch.startMs / 1000 : 0);
|
||||
if (resumeMs > 0) this.startedPlaying = Date.now() - resumeMs;
|
||||
|
||||
if (!playUri || !Utils.isValidUrl(playUri)) {
|
||||
logger.warn(`[Player] No valid URL for track: ${songData.title} (url=${songData.url}), trying search...`);
|
||||
|
||||
Reference in new issue
Block a user