Introduction¶
When coding for extended periods in DSH, researching materials, or chatting with models, the background playlist often doesn’t match the current state: either it’s stuck on the same set of songs, or you have to manually switch applications. Manually picking songs based on chat content is costly and may not align with specific works or events you just discussed.
Mood Radio is a DSH plugin maintained by community maintainer SAI-h, categorized as a network tool. It provides an entry point in the sidebar, reads the most recent messages of the current session, infers mood and specific topics, plays matching songs in the background on the local NetEase Cloud Music (also compatible with QQ Music / Spotify), and automatically queues songs. Sentiment analysis is performed locally on the DSH Host machine; the original conversation text is not uploaded.
What is This¶
Plugin repository: SAI-h/dsh-mood-dj. Directory page: SkillHub Plugin Page.
The version in package.json is 0.1.1, license MIT, requires Node >=18.17.0. It is a bundle with dsh.bundle.patch and a Web sidebar client: it inserts the mood-dj line via cordis.patch.yml, displaying the “Mood Radio” icon in the DSH sidebar.
Core Features¶
Song Selection Logic¶
When the panel is opened, the plugin combines the following sources (fallback in order if no clear mood signal):
- Current session inferred mood;
- Mood of the previous song;
- “Like/Skip” feedback in the local listening diary;
- Current time period (Late Night / Morning / Work Hours / Night).
Sentiment analysis prioritizes calling the current DSH model: it summarizes the recent real user statements into a single sentiment judgment, then selects songs based on that; analysis of the same dialogue round is cached for 10 minutes. The model also extracts specific objects explicitly mentioned by you (Anime / Movies / Games, events, locations, activities). For example, talking about “Attack on Titan” will prioritize searching for related theme songs; generic “Anime”, “Music”, as well as technical/product/plugin/warehouse/path words will not be treated as topics.
Each batch inserts 5 songs of the same atmosphere at the tail of the queue. Up to 3 songs related to the topic, then 2 “New Discoveries” from public playlists, the rest filled by the built-in library; when topic search fails or no specific object exists, “New Discoveries + Mood Profile” takes over. Continuous batches will avoid the recent 12 songs, and the same batch tries not to repeat the same artist; cards will be marked “Library / Topic / New Discovery” to facilitate identification of fallbacks.
Panel and Auto-fill¶
Typical operations are as follows:
- Sidebar “Mood Radio” → Open panel. On first open, or if more than 6 hours have passed since the last selection, it will automatically select songs; opening again within 6 hours will stop on the last selected song, not automatically change the track.
- Inside the panel, you can “Replay”, “Next”, “Turn down volume”; only these operations actively change the song.
- Top “Collect Mood in Conversation” turned on, the radio will automatically analyze and queue the next batch when the song is about to end; turned off, it only plays when you click the button.
- When “Auto-fill” is turned off, playback stops after the current queue finishes.
- The panel syncs current playing track and queue count every 5 seconds; “Like/Skip” writes to the local listening diary for future song selection reference.
If obvious emotions like “Annoying / Tired / Uncomfortable / Happy” appear in the conversation, and collection is enabled, they will be recorded in the current mood window and analyzed uniformly during auto-fill; it will not hard-cut the current song for a single sentence.
Playback and Background Track Switching¶
Songs are delivered via NetEase Cloud Music desktop client’s orpheus://<base64> deep link (payload like {"type":"song","id":"...","cmd":"play"}). For VIP songs, non-Vinyl member playback counts 30 seconds of trial into duration; when a batch of trial plays finishes in order and pauses, it will try to queue the next batch.
On Windows, the local Chromium Control Channel (CDP) of NetEase Cloud Music desktop client is prioritized: if not running, you can start the client with --remote-debugging-address=127.0.0.1 --remote-debugging-port=9223 before switching tracks; if CDP is already enabled, switching tracks won’t steal focus. If the client is running but CDP is not enabled, it can fallback to deep links; the panel provides “Enable Background Switch” to restart the client and enable background control.
Installation and Enablement¶
Install from GitHub (original command in docs):
dsh plugin add -w github:SAI-h/dsh-mood-dj
You can also hand the plugin directory to DSH’s plugin_manager for installation. It is recommended to read the repository source code and MIT license before installing; the plugin runs with the current dsh process permissions, will read/write local state and invoke the music client.
Data and Environment Variables¶
Default path for listening diary:
~/.dsh/mood-dj/state.json
Only saves song id, title, artist, mood tags, time, and feedback; does not save original conversation text. You can change the storage location with environment variables:
MOOD_DJ_HOME=/path/to/dsh-save-place
Optional: ncm-cli¶
@music163/ncm-cli is not installed automatically with the plugin, suitable for search, playlists, and TUI. On Windows, its orpheus player is unavailable, need to set player to mpv and ensure mpv is in PATH; this is an independent path from the radio’s default “Official Client + CDP”. API private key needs to be executed in your own terminal with ncm-cli config set privateKey, do not write into plugin config or logs.
Limitations and Notes¶
- Automatic playback accurate to the song relies on the
orpheus:protocol registered by the NetEase Cloud Music desktop client; other clients will try to open and prompt for manual confirmation. - Mood inference is based on local interpretable keyword/punctuation/emoji signals (the “Limitations” section of the README also states that external models are not called for this layer of inference); complex irony or very obscure expressions may not be accurate.
- The built-in library is a small playlist manually selected, each with a verified NetEase Cloud Music song id.
- Enabling background control for the first time may require restarting the NetEase Cloud Music client once.
Conclusion¶
Mood Radio connects the mood and topics in DSH sessions to the local NetEase Cloud Music queue, suitable for users who want background music to change with their state during development or conversation, without having to manually search for songs repeatedly. The community plugin directory and DeepSeek / Fangyuan have no official affiliation; installation and behavior follow the repository README.
- Directory page: https://www.skillhub.cn/plugins/SAI-h/dsh-mood-dj
- GitHub: https://github.com/SAI-h/dsh-mood-dj