Add seek validation, autoplay system, progress bar & codebase cleanup

- Add seek duration validation — seeks beyond track length are rejected
  with clear error showing max allowed position
- Add autoplay system with Last.fm similar tracks + YouTube search
  fallback — automatically queues similar tracks when queue ends
- Add live progress bar to now playing with elapsed/total time display
- Add robust ffmpeg cleanup to prevent race conditions during
  seek/skip/filter operations
- Add proper queue advancement after seek so bot stays in voice
- Add queueEnd event emission on skip/skipTo for autoplay trigger
- Add _lastPlayedTrack preservation for autoplay recommendations
This commit is contained in:
NoLogicAlan committed 2026-05-21 02:04:05 +03:00
1 parent bc1fe82919
commit 0f2ee99f1e
23 files changed
+665 -170

No files matched your search

-6
View File
@@ -12,7 +12,6 @@ import { Utils } from "./Utils.mjs";
import { PROVIDERS } from "./constants/providers.mjs";
import { logger } from "./constants/Logger.mjs";
const nl = workerData?.data?.nodelink ?? {};
const NL_HOST = nl.host ?? "localhost";
const NL_PORT = nl.port ?? 3000;
@@ -46,7 +45,6 @@ function sanitizeError(msg) {
return s;
}
/**
* Make a GET request to NodeLink and return the parsed JSON body.
* @param {string} path - API path (e.g. "/v4/loadtracks?identifier=…")
@@ -97,7 +95,6 @@ async function loadTracks(identifier, nlGetFn = nlGet) {
return nlGetFn(`/v4/loadtracks?identifier=${encodeURIComponent(identifier)}`);
}
/**
* Convert a NodeLink track object to the internal video format.
* @param {object} track
@@ -142,10 +139,8 @@ function tokenizeMatchText(value) {
return normalizeMatchText(value).split(" ").filter(Boolean);
}
const TYPE_MODIFIERS = ["track","playlist","album","artist","channel","user"];
class YTUtils extends EventEmitter {
constructor() { super(); }
@@ -451,7 +446,6 @@ class YTUtils extends EventEmitter {
}
}
const jobId = workerData?.jobId;
const data = workerData?.data;