feat: add subsonic proxy architecture with external music services

- Add MusicModels (Song, Artist, Album, SearchResult, DownloadInfo)
- Add IMusicMetadataService and DeezerMetadataService for external search
- Add IDownloadService and DeezspotDownloadService for downloads
- Add LocalLibraryService for managing downloaded songs cache
- Add custom endpoints: search3, stream, getSong, getAlbum, getCoverArt
- Configure dependency injection for all services
This commit is contained in:
V1ck3s
2025-12-08 15:09:39 +01:00
committed by Vickes
parent 1e8bfd108e
commit 6b07ac7646
9 changed files with 1493 additions and 66 deletions

View File

@@ -1,4 +1,5 @@
using octo_fiesta.Models;
using octo_fiesta.Services;
var builder = WebApplication.CreateBuilder(args);
@@ -9,9 +10,15 @@ builder.Services.AddHttpClient();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
// Configuration
builder.Services.Configure<SubsonicSettings>(
builder.Configuration.GetSection("Subsonic"));
// Services métier
builder.Services.AddSingleton<ILocalLibraryService, LocalLibraryService>();
builder.Services.AddScoped<IMusicMetadataService, DeezerMetadataService>();
builder.Services.AddScoped<IDownloadService, DeezspotDownloadService>();
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
@@ -22,22 +29,22 @@ builder.Services.AddCors(options =>
.WithExposedHeaders("X-Content-Duration", "X-Total-Count", "X-Nd-Authorization");
});
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseCors();
app.MapControllers();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseCors();
app.MapControllers();
app.Run();