mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
fix: address Copilot PR review findings
- Register DeezerDownloadService and DeezerMetadataService as Singleton to properly share state across requests (rate limiting, download tracking) - Fix race condition in LocalLibraryService.LoadMappingsAsync with double-check locking pattern - Dispose HttpRequestMessage objects to prevent memory leaks (4 occurrences) - Handle fire-and-forget TriggerLibraryScanAsync with proper error logging - Replace Console.WriteLine with ILogger in SubsonicController - Fix while loop in DownloadSongAsync to refresh activeDownload state - Use modern C# range operator syntax for Substring calls - Clean up appsettings.json template (remove private IP, clear ARL token) - Add documentation comment for Blowfish decryption key - Add downloads directory to gitignore
This commit is contained in:
@@ -15,9 +15,10 @@ builder.Services.Configure<SubsonicSettings>(
|
||||
builder.Configuration.GetSection("Subsonic"));
|
||||
|
||||
// Business services
|
||||
// Registered as Singleton to share state (mappings cache, scan debounce, download tracking, rate limiting)
|
||||
builder.Services.AddSingleton<ILocalLibraryService, LocalLibraryService>();
|
||||
builder.Services.AddScoped<IMusicMetadataService, DeezerMetadataService>();
|
||||
builder.Services.AddScoped<IDownloadService, DeezerDownloadService>();
|
||||
builder.Services.AddSingleton<IMusicMetadataService, DeezerMetadataService>();
|
||||
builder.Services.AddSingleton<IDownloadService, DeezerDownloadService>();
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user