testing this for a day if its bad i just wast my time

This commit is contained in:
NoLogicAlan committed 2026-10-05 03:29:05 +03:00
1 parent fd58343ce9
commit 656cbfe149
33 files changed
+726 -102

No files matched your search

+4 -1
View File
@@ -122,6 +122,7 @@ const PlaybackMixin = {
if (currentBeforeNext) this._lastPlayedTrack = currentBeforeNext;
const songData = this.queue.next();
if (!songData) {
this._consecutiveErrors = 0;
this.emit("stopplay");
this.emit("queueEnd");
@@ -171,7 +172,6 @@ const PlaybackMixin = {
this._paused = false;
this._pausedAt = null;
this._queueEndedSent = false;
this._consecutiveErrors = 0;
this._radioReconnects = 0;
if (songData.type !== "radio" || !this._radioAnnounced) {
@@ -214,6 +214,8 @@ const PlaybackMixin = {
await this._playTrackViaBridge(songData, { seekSeconds: seekSec });
}
this._consecutiveErrors = 0;
if (trackOptMatch && trackOptMatch.endMs > 0) {
const elapsedMs = Date.now() - this.startedPlaying;
const remainingMs = trackOptMatch.endMs - elapsedMs;
@@ -313,6 +315,7 @@ const PlaybackMixin = {
url: bridgeUrl,
title: songData.title,
guildId: this._guildId,
trusted: songData.type === "radio" || songData.type === "bilibili",
}, {
seekSeconds: options.seekSeconds ?? 0,
durationMs,
+3 -3
View File
@@ -67,7 +67,7 @@ export class Queue extends EventEmitter {
* @returns {string} Result message indicating success or out-of-bounds error.
*/
remove(idx) {
if (idx < 0 || idx >= this.data.length) return "Index out of bounds";
if (!Number.isInteger(idx) || idx < 0 || idx >= this.data.length) return "Index out of bounds";
const title = this.data[idx].title;
const removed = this.data.splice(idx, 1);
this.emit("queue", { type: "remove", data: { index: idx, old: this.data.slice(), removed, new: this.data } });
@@ -81,8 +81,8 @@ export class Queue extends EventEmitter {
* @returns {string} Result message indicating success or error.
*/
move(from, to) {
if (from < 0 || from >= this.data.length) return "Source index out of bounds";
if (to < 0 || to >= this.data.length) return "Target index out of bounds";
if (!Number.isInteger(from) || from < 0 || from >= this.data.length) return "Source index out of bounds";
if (!Number.isInteger(to) || to < 0 || to >= this.data.length) return "Target index out of bounds";
if (from === to) return "Track is already in that position";
const [track] = this.data.splice(from, 1);
this.data.splice(to, 0, track);