reloadConfig/updateConfig updated the network proxy but never re-pushed the
YouTube settings, so editing youtubeApiKey and reloading had no effect — the
YouTube client kept its startup key. Add MusicManager::applyYouTubeConfig()
(API key, cookies, concurrency, URL shortening; empty key clears it -> yt-dlp
fallback) and call it from both reloadConfig and updateConfig.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two gaps let network calls escape the configured proxy:
1. NetworkClient::executeRequest read proxy_ without holding mutex_, while
setProxy()/initialize() write it from other threads (init, config reload).
A torn read of optional<ProxyConfig> (it holds std::string host/user/pass)
could yield an empty host -> enabled()==false -> a silent DIRECT connection.
yt-dlp/ffmpeg snapshot their proxy under their own mutexes, so only the
HTTP path (YouTube Data API, URL shortener) was affected — matching the
observed "YouTube API without proxy". Snapshot proxy_ under the lock.
2. Core::reloadConfig updated only the config copy + command manager; it never
re-applied the proxy to the network stack, so editing the proxy and running
!reloadconfig left every client on the old/no proxy. Add
MusicManager::applyNetworkConfig() to push the proxy to the NetworkClient,
the yt-dlp subprocess, and the ffmpeg AudioDecoder at once, and call it from
both reloadConfig and updateConfig (which previously touched only the HTTP
client). reloadConfig now also syncs the shared ConfigManager.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
F1 (reload commands): Core registers itself as Api::ICoreInterface in the
service registry; !reloadconfig and !reload resolve it via ctx.service and
call Core::reloadConfig() (which reloads config.json from disk), replacing
the old placeholder replies.
F2 (SOCKS5 playback): ffmpeg can't use a SOCKS5 proxy, so it connected
directly to the IP-locked googlevideo URL and timed out; the fallback then
buffered the whole (705 MB) body in memory and tripped Void::Net's body
limit. New YouTubeClient::downloadAudioToFile() re-downloads the audio with
yt-dlp (which handles SOCKS5 + writes to disk) by video id and ffmpeg opens
the local file. MusicManager::downloadAudioForPlayback now uses it, and the
play-open path short-circuits straight to the download when the proxy is
SOCKS5 (skipping the doomed ~15 s ffmpeg attempt); HTTP/no-proxy keeps
stream-first-then-download.
F3 (API fallback): YouTubeClient::search() now falls back to yt-dlp when the
Data API path errors (bad/expired key, quota, network), mirroring what
fetchPlaylistItems already did.
Build green; runtime behaviour to be verified on the live bot.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the playback queue + shuffle state (the queue vector, shuffled-index
list, shuffle cursor, next-queue-id counter, and RNG) into a QueueManager
class. To preserve the real-time playback loop's exact behavior, the design
is deliberately minimal: QueueManager is a non-thread-safe data holder that
exposes its containers by reference, and MusicManager keeps its single
playback mutex_/cv_ and drives QueueManager under it. Every former queue_/
shuffledIndices_/shuffleIndex_/nextQueueId_/rng_ site is a 1:1 rename to the
accessor with identical semantics — no logic, locking, or ordering change.
Build green. Runtime behavior in the live playback loop is unverified here
(no audio/TeamSpeak); this is an isolated, revertible commit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the async, streaming playlist-load orchestration (the background load
thread, loading/loaded/total counters, and the getPlaylistStreaming wiring)
into a PlaylistLoader class. It enqueues resolved tracks via an injected
callback (-> queueTrack) and asks the owner to start playback on the first
track via requestPlaybackStart() — the single seam back to the audio loop,
which still owns the auto-start thread + cv_ poke. loadPlaylist() now just
delegates. Behavior preserved; build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the echoion Logger adapter (Logger.{hpp,cpp}) and the
ILogger/LoggerRegistry indirection. Core::installLogging() builds the
console + split-file Void::Logging::MultiLogger and installs it as the
process-wide Void::Log sink via Void::Log::make_sink (logSink_ owns it for
the process lifetime). The ~450 ECHOION_LOG_* call sites across EchoionCore
are rewritten to Void::Log::<level>("<Subsystem>", "{}", <expr>) with
per-file module tags (warning->warn, critical->fatal); the pre-formatted
message is passed as the single "{}" argument. Build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Core holds a ConfigManager member, keeps it synced (updateConfig(config_)),
and provides it as a service. ConfigManager.cpp drops the instance()
definition. MusicManager gets the manager via setConfigManager() and reads
sections through it (former ECHOION_BOT/YOUTUBE/NETWORK sites); RpcInfoCommand
resolves it from the registry via ctx.service<Api::ConfigManager>(). Build
green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Core holds a Void::EventBus::EventBus (Async), provides it as a service, and
runs its 18 event subscriptions against it directly (setupEventBusSubscriptions
is no longer const since it now mutates the owned bus). MusicManager gets the
bus via setEventBus() and publishes through a small emit<T>() helper (14
former GlobalEventBus publish sites). Delete EventBus.cpp (the singleton
definition). Build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete NetworkClient's to_void_method/to_void_proxy/to_api_response bridge
and the Api::RetryConfig member; the client builds Void::Net::Request, sends
via Void::Net::HttpClient, returns Void::Net::Response, and retries via an
internal Void::Retry policy + retryable-status list.
Call sites updated to Void::Net member names: isSuccess()->ok(),
statusCode->status, getHeader()->header() (optional<string_view>),
isRedirect()->status range check; proxy isValid()->enabled(),
requiresAuth()->has_auth(), isSocks5()->kind == Kind::Socks5. Proxy fields
flow through YtDlpManager/AudioDecoder/MusicManager unchanged in spelling.
On-disk proxy shape is now Void::Net::ProxyConfig (kind: None/Http/Socks5);
config.example.json updated and proxy round-trip verified. Build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mechanically convert std::unexpected(Api::Error(ErrorCode::X, msg[, src]))
to Api::fail(ErrorCode::X, msg[, src]) across Core. Pure syntax; forwards of
existing errors (std::unexpected(x.error())) are unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>