feat/apple music and optimizations#2
Open
daimoxd wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a major overhaul of the audio, UI, and backend architecture to achieve extreme memory optimizations (zero-allocation hot paths). Additionally, it integrates a powerful new Apple Music module with a provider selector and a revamped TUI slash-command system.
Apple Music & New TUI Features
/provider): Dynamically switch the active catalog betweenyoutubeandapple.apple.ts,gamdl.ts): Resolves, fetches libraries, and plays Apple Music tracks usinggamdlunder the hood. Requires authentication cookies to be set via/auth <cookies>.applemusic-api: Integrated a custom fork to enable direct fetching from the Apple Music catalog.commands.ts): Added a robust command bar at the bottom (/search,/library,/auth,/pause,/help, etc.).cli.ts):catunes doctornow checks and reports the status ofgamdl.Improved Performance & Zero-Allocation Hot Paths
audio.ts):.map()andnew Float64Array()instances on every frame. Pre-allocated_re,_im,_bands, and_wavestatic buffers.PcmBuffer: a custom 64KB circular ring-buffer, entirely avoiding costlyBuffer.concat()garbage collection cycles during playback.app.tsx):specBufRef,peakBufRef) for the React state to stop spreading arrays every tick.Visualizer,PixelCat,NowPlaying,PickList, andPanelinReact.memoto drop redundant UI re-renders.player.stateobject; React now only re-renders when data actually changes.server/index.ts):_rosterPayload) to avoid recreating objects on every single WebSocket broadcast.config.ts,playlist.ts,status.ts):loadSettings()andloadPlaylist(). Writes to disk are now batched to prevent unnecessary I/O.fmtTimeinfmt.tsto reduce code duplication.Documentation
README.mdandREADME.es.mdto properly document the new/authrequirement for Apple Music.gamdland local file handling.