| Name | Message | Date |
|---|---|---|
| 📁 Properties | 8 days ago | |
| 📄 appsettings.Development.json | 8 days ago | |
| 📄 appsettings.json | 9 days ago | |
| 📄 Cli.csproj | 8 days ago | |
| 📄 packages.lock.json | 8 days ago | |
| 📄 Program.cs | 8 days ago |
📄
src/Cli/Program.cs
using System.Threading; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Slopper.Domain; using Slopper.Infrastructure.Ai; using Slopper.Infrastructure.Database; using Slopper.Infrastructure.Ffmpeg; var builder = Host.CreateApplicationBuilder(); builder.Services.AddClipSelector(); builder.Services.AddJellyfinDatabase().AddFfmpegServices().AddAi(); using var app = builder.Build(); var options = app.Services.GetRequiredService<IOptions<ClipSelectorOptions>>(); var media = new MediaItem("test", args[0], new Subtitles.Embedded(0)); var subtitleReader = app.Services.GetRequiredService<ISubtitleReader>(); var subtitles = await subtitleReader.ReadSubtitles(media, CancellationToken.None); var clipSelector = app.Services.GetRequiredService<ClipSelector>(); var (start, duration) = await clipSelector.PickClip(subtitles, CancellationToken.None); var clipExtractor = app.Services.GetRequiredService<ClipExtractor>(); await clipExtractor.Clip(media, start, duration, args[1]);