using AZKiServer.Models; using MongoDB.Driver; using System.Collections.Frozen; namespace AZKiServer.Services; public class MediaService(IMongoDatabase db) { public readonly IMongoCollection _entries = db.GetCollection("media"); public async Task> GetExistingFilePathsAsync(CancellationToken cancellationToken = default) { var files = await _entries.Find("{}").Project(m => m.Filepath).ToListAsync(cancellationToken); return files.ToFrozenSet(); } public async Task AddMediaBulkAsync(List entries, CancellationToken cancellationToken = default) { await _entries.InsertManyAsync(entries, cancellationToken: cancellationToken); } public class IndexCreation : BackgroundService { protected override Task ExecuteAsync(CancellationToken stoppingToken) { throw new NotImplementedException(); } } }