Commit Graph
15 Commits
Author SHA1 Message Date
faumaray 9637f1eef7 Core: add configurable startup log rotation 2026-07-28 21:10:09 +03:00
faumaray 7975f2b38e update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-25 23:44:42 +03:00
faumaray 9f06af6c80 Update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-16 19:59:45 +03:00
faumaray 39aff68d8d Update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-15 19:49:57 +03:00
faumaray 01362d2e51 Update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-12 02:56:29 +03:00
faumaray 5c036d91fb making WEB
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-11 00:45:17 +03:00
faumarayandClaude Opus 4.8 499143050b Implement reload commands; fix SOCKS5 playback; API->yt-dlp search fallback
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>
2026-06-24 21:11:20 +03:00
faumarayandClaude Opus 4.8 30884ad0b5 Decompose Core: split RPC/event setup into files + dedupe init guards
Move Core::setupRpcHandlers (→ CoreRpcHandlers.cpp) and
Core::setupEventBusSubscriptions (→ CoreEventRelay.cpp) out of the
2100-line Core.cpp (now ~1535). They stay Core member functions —
definitions live in dedicated translation units — which gives the
file-decomposition without a risky 500-line this→core rewrite into separate
classes. The RpcAuthRequest struct moves to RpcDtos.hpp as Dto::AuthRequest;
the toJson<T> helper also moves there so both units share it.

Add Core::requireInitialized() and collapse the 28 identical
`if (!initialized_) return fail(ServiceUnavailable,…)` guards into
`if (auto r = requireInitialized(); !r) return std::unexpected(r.error());`.

Build green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:26:26 +03:00
faumarayandClaude Opus 4.8 75ee32a24b Remove dead NetworkClient/Core methods + orphaned pool
Delete NetworkClient getAsync/postAsync/requestAsync/requestBatch/getJson/
postJson and the now-unused parseJson + ThreadPool pool_ member (sync
get/post/request + proxy remain). Delete Core::getQueueSummaries. Build green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:27:22 +03:00
faumarayandClaude Opus 4.8 2d7651c308 Route all logging through the Void::Log facade
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>
2026-06-23 14:10:06 +03:00
faumarayandClaude Opus 4.8 0e08ccaefa Own ConfigManager in Core; resolve config via DI instead of the singleton
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>
2026-06-23 14:01:31 +03:00
faumarayandClaude Opus 4.8 f7553d10d3 Own the event bus in Core; inject it into MusicManager
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>
2026-06-23 13:56:32 +03:00
faumarayandClaude Opus 4.8 32fbffa171 Introduce a service registry as Core's composition root
Add Void::Service::ServiceRegistry to Core. initialize() now registers every
service by interface — ILogger, ConfigManager, EventBus, INetworkClient,
Database, MusicManager, RpcServer — so code can resolve them via
Core::services().require<I>() instead of reaching for global singletons. The
three former singletons (logger/config/event bus) are wrapped in non-owning
aliasing shared_ptrs and remain valid behind the ECHOION_LOG_*/PUBLISH/
SUBSCRIBE macros; the registry just makes them discoverable as services.

This establishes the DI backbone; migrating individual call sites to
registry resolution is intentionally incremental. Requires the VoidLibrary
fix allowing non-polymorphic service types in provide<I>. Link Void::Service.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:00:31 +03:00
faumaray 2bdb63766d Migrate core infrastructure to VoidLibrary 2026-06-22 15:53:23 +03:00
faumaray a583c17916 Initial commit 2026-02-01 23:04:49 +03:00