mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
refactor: extract subsonic controller logic into specialized services
- Extract SubsonicRequestParser for HTTP parameter extraction - Extract SubsonicResponseBuilder for XML/JSON response formatting - Extract SubsonicModelMapper for search result parsing and merging - Extract SubsonicProxyService for upstream Subsonic server communication - Add comprehensive test coverage (45 tests) for all new services - Reduce SubsonicController from 1174 to 666 lines (-43%) All tests passing. Build succeeds with 0 errors.
This commit is contained in:
@@ -4,6 +4,7 @@ using octo_fiesta.Services.Deezer;
|
||||
using octo_fiesta.Services.Qobuz;
|
||||
using octo_fiesta.Services.Local;
|
||||
using octo_fiesta.Services.Validation;
|
||||
using octo_fiesta.Services.Subsonic;
|
||||
using octo_fiesta.Middleware;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -34,6 +35,12 @@ var musicService = builder.Configuration.GetValue<MusicService>("Subsonic:MusicS
|
||||
// Registered as Singleton to share state (mappings cache, scan debounce, download tracking, rate limiting)
|
||||
builder.Services.AddSingleton<ILocalLibraryService, LocalLibraryService>();
|
||||
|
||||
// Subsonic services
|
||||
builder.Services.AddSingleton<SubsonicRequestParser>();
|
||||
builder.Services.AddSingleton<SubsonicResponseBuilder>();
|
||||
builder.Services.AddSingleton<SubsonicModelMapper>();
|
||||
builder.Services.AddSingleton<SubsonicProxyService>();
|
||||
|
||||
// Register music service based on configuration
|
||||
if (musicService == MusicService.Qobuz)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user