Spaces:
Sleeping
Sleeping
Download src/ClipForge.Infrastructure/DependencyInjection.cs from clipeforge/app: direct link, hf CLI and curl.
- Browser
- Download file 2.16 kB
-
https://huggingface.co/spaces/clipeforge/app/resolve/main/src/ClipForge.Infrastructure/DependencyInjection.cs
- Command line
-
hf download hf://spaces/clipeforge/app/src/ClipForge.Infrastructure/DependencyInjection.cs
-
curl -L -o DependencyInjection.cs https://huggingface.co/spaces/clipeforge/app/resolve/main/src/ClipForge.Infrastructure/DependencyInjection.cs
2.16 kB
| using ClipForge.Core.Interfaces; | |
| using ClipForge.Core.Interfaces.Services; | |
| using ClipForge.Infrastructure.Configuration; | |
| using ClipForge.Infrastructure.Data; | |
| using ClipForge.Infrastructure.Repositories; | |
| using ClipForge.Infrastructure.Services; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| namespace ClipForge.Infrastructure; | |
| public static class DependencyInjection | |
| { | |
| public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration) | |
| { | |
| // Configuration | |
| services.Configure<OpenAiSettings>(configuration.GetSection(OpenAiSettings.SectionName)); | |
| services.Configure<PexelsSettings>(configuration.GetSection(PexelsSettings.SectionName)); | |
| services.Configure<StorageSettings>(configuration.GetSection(StorageSettings.SectionName)); | |
| // Database | |
| services.AddDbContext<AppDbContext>(options => | |
| options.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))); | |
| // Repositories | |
| services.AddScoped<IVideoIdeaRepository, VideoIdeaRepository>(); | |
| services.AddScoped<IVideoScriptRepository, VideoScriptRepository>(); | |
| services.AddScoped<IVideoAssetRepository, VideoAssetRepository>(); | |
| services.AddScoped(typeof(IRepository<>), typeof(BaseRepository<>)); | |
| // HTTP Clients | |
| services.AddHttpClient<IOpenAiClient, OpenAiClient>(); | |
| services.AddHttpClient<IStockMediaService, GoogleImageSearchService>(); | |
| // Services | |
| services.AddScoped<IFfmpegService, FfmpegService>(); | |
| services.AddScoped<EdgeTtsService>(); | |
| services.AddScoped<IIdeaGenerationService, IdeaGenerationService>(); | |
| services.AddScoped<IScriptGenerationService, ScriptGenerationService>(); | |
| services.AddScoped<IVoiceGenerationService, VoiceGenerationService>(); | |
| services.AddScoped<IVideoAssemblyService, VideoAssemblyService>(); | |
| services.AddScoped<ISubtitleService, SubtitleService>(); | |
| services.AddScoped<ISchedulerService, SchedulerService>(); | |
| return services; | |
| } | |
| } | |