Skip to content

Fix/spotify search#214

Closed
realkalashnikov wants to merge 59 commits into
PerformanC:v3from
realkalashnikov:fix/spotify-search
Closed

Fix/spotify search#214
realkalashnikov wants to merge 59 commits into
PerformanC:v3from
realkalashnikov:fix/spotify-search

Conversation

@realkalashnikov

Copy link
Copy Markdown

Changes

  • Decoupled the Spotify search query limit parameter from the playlistLoadLimit configuration.
  • Refactored the search() method in src/sources/spotify.ts to retrieve and use this.nodelink.options.search.maxResults (defaulting to 10) instead of this.config.playlistLoadLimit.

Why

The official Spotify text search query API calls (/v1/search) were incorrectly inheriting the playlistLoadLimit configuration, which is designed solely to limit the amount of pages loaded when fetching Spotify Playlists, Albums, or Artists.

If a user configured a low playlistLoadLimit (e.g., 1 or 2 to avoid massive playlist ingestion and API rate limits), text-based Spotify searches (spsearch) would yield only 1 or 2 results instead of the expected search result list count.

Standardizing on search.maxResults fixes this text search limitation bug and aligns the Spotify source's text search behavior with all other sources (such as Apple Music, Tidal, and Deezer) in NodeLink.

Checkmarks

  • The modified endpoints have been tested.
  • Used the same indentation as the rest of the project.
  • Still compatible with LavaLink clients.

Additional information

This bug caused Discord music bots using NodeLink to always return only a single track choice when users searched by keyword using the Spotify source, if playlist loading restrictions were active.

ToddyTheNoobDud and others added 30 commits April 30, 2026 13:50
this is the gap between heapTotal and the v8 heap space, this revels v8
internal memory.
fixes the npm build error.
Added support for playing tiktok videos.
After some researching and testing, aead_xchacha20_poly1305_rtpsize runs
natively on libsodum + has support for encrypt_into apis, that on my
machine, gave an 300% speed boost in decrypt/encrypt packets, since it
runs on sodium-native or libsodium-wrappers, only by running on these
packages makes it faster. Also tested with bun, sodium-native is still
faster than it by ~80%.
Fixed fadeTo/tapeTo/setFadeVolume silently no-oping on
connection.audioStream   (missing from _assignStream proxy)
Fixed 'audioStream' event listener being dead code (voice lib never
emits it)
Fixed 'reconnecting' connection status never firing (voice lib uses
connecting state, not reconnecting)
Fixed pause detection broken (voice lib uses idle+reason='paused', not
status='paused')
Fixed double-destroy race in _cleanupCurrentAudioStream
Fixed stuck detection conflict (set stuckTimeout above player threshold)
Fixed force=true reconnect being no-op when token+endpoint unchanged
Fixed ping -1 not caught by nullish coalescing

Implement setLoudnessNormalizer runtime toggle via
VolumeTransformer.setAGCEnabled
Handle circuit breaker disconnect reason
Update type declarations to match actual voice lib behavior
Remove 'seamless_bridge' from playing reason check, add 'unpaused'
Formmated the entire code with biome.
Replaced the circular ring buffer (RING_SIZE, writePos/readPos tracking,
swap buffer for wrap-around copies) with a straightforward leftover
strategy. Incoming chunks are concatenated with any leftover bytes using
bufferPool, full frames are encoded in a single pass, and remaining
bytes are saved for the next transform call. This reduces memory
overhead (no fixed 512KB ring allocation), eliminates wrap-around
complexity, and properly releases pooled buffers on error and flush.

After testing this for 2d, managed to get a 97% buffer reuse, which
alones gets an ~200/400mb saving in memory.
since its gonna be an LTS in october, and can run TS natively, i have
updated the experimental flag and fixed an error on config validator
causing it to crash on startup.
Since tidal does not seem to work now, will be default to qobuz.
Replaced the fragile NODE_UNIQUE_ID environment variable approach with
an explicit two-step identification protocol:

Master sends clusterId via IPC on fork
Worker confirms identity with HELLO packet (incl. PID) over event socket

Changed eventSockets from Set to Map keyed by worker ID. This enables
reliable mapping, stale socket cleanup on reconnect, and correct stats
attribution

Fixes an issue where /v4/workers showed complete stats only for worker
ID 1 all workers reported workerId: 1, so their stats overwrote each
other, leaving other worker IDs with only the initial { players: 0,
playingPlayers: 0 } stub.
resampler.destroy() was being called twice.
Lazily allocate tape/scratch effect buffers only when those effects are
used, instead of retaining them for every playback pipeline.

Lowered oversized AAC and WebM demux ring buffer defaults that were
retained per active stream.

Added teardown cleanup for playback filters and mixers so ended streams
release native buffers promptly.

From my tests on the playback worker, with 19 active players, the
JSArrayBufferData went from ~146MB to ~19.5MB.
This should help with client compatibility.
* fix: dynamicly spelling to dynamically

Signed-off-by: Ramkrishna <144999854+ramsquishna@users.noreply.github.com>

* fix: exaustive spelling to exhaustive

Signed-off-by: Ramkrishna <144999854+ramsquishna@users.noreply.github.com>

---------

Signed-off-by: Ramkrishna <144999854+ramsquishna@users.noreply.github.com>
Symphonia v0.6.0
Rubato v2.0.0
And fixed FLAC playback, ig thats good.

New repo: https://github.com/ToddyTheNoobDud/symphonia-decoder
Pass abort signal into DASH segment fetches so stop() cancels in-flight
downloads. Refactor DASHHandler backpressure from data-event drain
detection to _read()-driven read-waiters. Replace .pipe() with
pipeline() for
proper error propagation and cleanup. Remove removeAllListeners() from
streamProcessor and AudioMixer in favor of owned listener cleanup.
Delete unreachable duplicate writableNeedDrain early-return in YouTube
recovery.

Also fixed an 403 error happening on bandcamp (by adding an Referer, and
fixed getTrackUrl capturing an trailing JSON.)
This seems to be no longer experimental and can be used in prod, since
bun got some major stability updates.
Also fix a crash ocurring during startup.
1Lucas1apk and others added 25 commits May 24, 2026 14:15
Signed-off-by: Lucas Morais Rodrigues <76886832+1Lucas1apk@users.noreply.github.com>
Well, this native dom should be faster, more memory efficient and wayyy
more lightweight. from what i used, it reduced the memory usage greatly,
consumed less cpu and reduced the disk space on node_modules by ~20/15mb
since jsdom is really heavy.

Tested with multiple songs, tested with jsdom tests, all passed, so
should not affect in a negative form at all.

(DOM only gets loaded when using SABR.)
- Implemented automatic audio quality fallback for consistent stream failures.
- Added proportional byte position shifting to maintain audio timing.
- Added client failure tracking to skip non-functional clients (e.g. AndroidVR).
- Removed 60s drain timeout to prevent paused streams from being destroyed.
- Fixed recovery race condition using an isRecovering flag.
- Refactored with strict TypeScript types and removed loose casts.
- Updated development version to 20260531.1 in package.json
- Implemented 10-minute check interval using CredentialManager for persistence.
- Prevents excessive external requests to GitHub/NPM on frequent server restarts.
- Optimized performance by skipping checks if the last one was recent.
- Replicated Node.js version check logic for dependencies.
- Added disk-based caching of latest versions to avoid redundant network requests.
- Ensured comparison and logging always occur at startup using cached or fresh data.
- Guaranteed log transparency by never skipping the update status report.
- Changed 'Installed core packages' log level from debug to info.
- Changed 'All core packages are up to date' log level from debug to info.
- Recognized these as fundamental pieces of information for server status.
this source is really unstable during the past 2 months, so it will be
disabled by default.
Moved all bun's related server handling to a new file, so the code can
be more organized when maintaining both node and bun. This also helps
unify the logic from both sides without many specific changes.

refactored cleanupBunServer to send proper close frames instead of force
killing the TCP, this should fix some weird session ID behavior on the
client side.

Refactored the session resume handler, before if a client sent a
session-id which points to a non-resumable session, it would be set to
null during upgrade, this would also cause the weird behavior on client
side. Now it will fall back to create a new session ID.

Added an early check on the heartbeat system that checks for bun, since
bun has sendPings natively, it prevents sending double pings.
- Move checkDependencyUpdates to the startup sequence.

- Add automatic update execution using pnpm or npm.

- Replace require.resolve with fs.readFileSync to bypass 'exports'.

- Implement self-restarting mechanism by spawning a child process.

- Add mp4box to the list of core packages monitored for updates.
- Clear track from long-term memory cache on stuck recovery.

- Avoid seeking to last position for streams during recovery to prevent loops.

- Add delete method to TrackCacheManager.
- Fix memory leak in YouTube failingClientsByTrack with 12h ttl clear

- Add predictive background token refresh to Spotify to prevent playback latency

- Enhance Player Garbage Collection for streams and underlying audio pipes

- Improve SponsorBlock seek resilience and recovery logic
This should remove the extra botguardData Object beign recived by the
responses in attestaion. Does not affect SABR.
Fixes an issue where voice library emits error before state updates.

Use process.nextTick to delay handling and check playerState.
This commit applies several architectural and performance improvements to player.ts:

- Deduplicate initialization logic into _connectAndPlayStream

- Fix waitEvent memory leak using strict local reference

- Replace spread with structuredClone for voice state

- Use node:timers/promises instead of custom sleep promise

- Ensure 'end' listener triggers on fetchResource stream

- Remove forced global.gc logic for stability
Fixed bitwise operator precedence in MPEGTSDemuxer PAT parsing to
correctly identify audio PIDs
Fixed libsamplerate-js dynamic import to properly handle ESM default
exports, resolving silent resampler failures. (Should fix Cannot read
properties of undefined (reading 'SRC_SINC_BEST_QUALITY') happening
internally.)

Should fix playback in gaana.
When a gaana stream ended, the player would falsely identify the track
as "stuck" because the player was still draining the audio buffer (this
would ocurr frequently especially on tracks that are non-seekable or 0
length tracks.)
Replaced explicit `any` usages in 14 files with proper types.
Added null guards to DSP buffer fields (float64Delay, delay, phonograph,
reverb) and stream processing classes (VolumeTransformer,
LoudnessNormalizer, FlowController) when setting fields to null in
destroy methods.
Added destroy optional method to FilterInstance interface. Extended
casts on external API responses, dynamic property access, and library
type mismatches.

Note: the only file which is required to use any is nativeDom, since it
can give a lot of varied results. Its better keeping any on it.
and migrated biome to v2.5
Copilot AI review requested due to automatic review settings July 1, 2026 05:39
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


2 out of 5 committers have signed the CLA.
✅ (1Lucas1apk)[https://github.com/1Lucas1apk]
✅ (realkalashnikov)[https://github.com/realkalashnikov]
@ToddyTheNoobDud
@UnschooledGamer
@ramkrishna
Ramkrishna seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants