| Name | Message | Date |
|---|---|---|
| 📁 Properties | 9 days ago | |
| 📄 appsettings.Development.json | 9 days ago | |
| 📄 appsettings.json | 9 days ago | |
| 📄 Cli.csproj | 9 days ago | |
| 📄 packages.lock.json | 9 days ago | |
| 📄 Program.cs | 9 days ago |
📄
src/Cli/Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Linq; using System.Reflection; using Jellyfin.Database.Implementations; using Jellyfin.Database.Implementations.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Slopper.Infrastructure.Database; var builder = Host.CreateApplicationBuilder(); builder.Configuration.AddUserSecrets(Assembly.GetExecutingAssembly()); builder.Services.AddJellyfinDatabase(); using var app = builder.Build(); var dbContext = app.Services.GetRequiredService<JellyfinDbContext>(); var subs = dbContext .MediaStreamInfos.AsNoTracking() .Include(s => s.Item) .Where(s => s.StreamType == MediaStreamTypeEntity.Subtitle && s.Language == "eng") .OrderBy(s => s.Item.SortName) .Take(4); var logger = app.Services.GetRequiredService<ILogger<Program>>(); await foreach (var sub in subs.AsAsyncEnumerable()) { logger.LogInformation( "{Title}: (IsExternal: {IsExternal}; Format: {Format}) {StreamIndex} {Path}", string.Join(" ", new[] { sub.Item.SeriesName, sub.Item.SeasonName, sub.Item.Name }.Where(s => s is not null)), sub.IsExternal, sub.Codec, sub.StreamIndex, sub.Path ); }