Skip to content

update new nodelink feats#44

Open
UnschooledGamer wants to merge 4 commits intomainfrom
update/nodelink-feats-new
Open

update new nodelink feats#44
UnschooledGamer wants to merge 4 commits intomainfrom
update/nodelink-feats-new

Conversation

@UnschooledGamer
Copy link
Copy Markdown
Member

  • WIP search prefixes.

greptile-apps[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

greptile-apps[bot]

This comment was marked as outdated.

@UnschooledGamer
Copy link
Copy Markdown
Member Author

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 17, 2026

Greptile Summary

This PR adds NodeLink-specific features to Riffy: gapless playback via sendNextTrack, volume fading via setFadings, and a searchType parameter in resolve() for NodeLink's extended search prefix format. It also exposes track.encoded as an alias for track.track on the Track class.

  • Critical bug in setFadings: The key-validation condition is inverted — it throws a TypeError when the key is valid (e.g. trackStart, seek), meaning setFadings is completely broken for all valid inputs and silently accepts invalid ones.
  • sendNextTrack hardcodes fading config: The method couples gapless-preload logic with a specific fading configuration, potentially overriding any previously set fading from setFadings.
  • SearchType type is missing: Riffy.resolve() references import("..").SearchType in its JSDoc, but this type is not declared in build/index.d.ts, breaking TypeScript consumers.
  • New Player methods undeclared: sendNextTrack and setFadings have no corresponding entries in the Player class declaration in build/index.d.ts.
  • NodelinkSearchPlatform is defined but not integrated: The newly added type is declared but not linked to a SearchType union or used in any method signature.
  • The searchType-aware node selection in resolve() and the identifier construction format ({source}:{searchType}:{query}) appear correct.

Confidence Score: 2/5

  • Not safe to merge — the new setFadings method is broken due to an inverted condition, and TypeScript type coverage for all new NodeLink features is incomplete.
  • A critical logic inversion in setFadings makes it throw for every valid input, meaning the feature ships completely non-functional. Additionally, the type declarations file is missing SearchType, sendNextTrack, and setFadings, leaving TS consumers without type safety for the new API surface.
  • build/structures/Player.js (inverted validation bug), build/index.d.ts (missing type declarations)

Important Files Changed

Filename Overview
build/structures/Player.js Adds sendNextTrack and setFadings NodeLink-specific methods. Contains a critical inverted validation bug in setFadings that causes it to always throw for valid keys, and sendNextTrack hardcodes fading config. Both new methods are missing TypeScript declarations.
build/structures/Riffy.js Adds searchType parameter to resolve() for NodeLink search prefix support. Node selection correctly prefers NodeLink nodes when searchType is provided. Identifier construction with searchType looks correct. References SearchType type that is not yet declared in the type definitions.
build/index.d.ts Adds NodelinkSearchPlatform type but is missing the referenced SearchType export and declarations for the new sendNextTrack/setFadings Player methods, leaving TypeScript consumers without type coverage for the new NodeLink features.
build/structures/Track.js Adds this.encoded as an alias for this.track (both set to data.encoded), enabling the new sendNextTrack method to access the encoded track string cleanly. Straightforward and safe change.

Sequence Diagram

sequenceDiagram
    participant User
    participant Player
    participant NodeREST as Node REST API

    Note over User,NodeREST: Gapless Playback (sendNextTrack)
    User->>Player: sendNextTrack(track)
    Player->>Player: validate playing & track.encoded
    Player->>NodeREST: PATCH /players/{guildId}<br/>{ nextTrack: { encoded }, fading: { enabled, trackStart } }

    Note over User,NodeREST: Volume Fading (setFadings)
    User->>Player: setFadings(enabled, fading)
    Player->>Player: validate fading object & keys
    Player->>NodeREST: PATCH /players/{guildId}<br/>{ fading: { enabled, ...fading } }

    Note over User,NodeREST: NodeLink Search (resolve with searchType)
    User->>Riffy: resolve({ query, source, searchType })
    Riffy->>Riffy: find NodeLink node if searchType provided
    Riffy->>NodeREST: GET /loadtracks?identifier={source}:{searchType}:{query}
    NodeREST-->>Riffy: trackResponse
    Riffy-->>User: nodeResponse
Loading

Last reviewed commit: 7151029

Comment thread build/structures/Player.js Outdated
Comment thread build/structures/Player.js
Comment thread build/index.d.ts
Comment thread build/index.d.ts
Comment thread build/structures/Player.js Outdated
UnschooledGamer and others added 3 commits March 18, 2026 13:11
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant