Implement media storage and processing features: update configuration in .env.example and appsettings files, enhance Docker setup for media storage, and add media-related services and database entities. Include ffmpeg for media handling and adjust Kestrel settings for large file uploads.

This commit is contained in:
Leonid Pershin
2026-07-24 08:33:11 +03:00
parent 1dd6991174
commit e15ecbdb29
47 changed files with 2599 additions and 1 deletions
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using TeleWave.Application.Common.Interfaces;
using TeleWave.Domain.Auth;
using TeleWave.Domain.Media;
using TeleWave.Infrastructure.Identity;
namespace TeleWave.Infrastructure.Persistence;
@@ -15,6 +16,7 @@ public class AppDbContext(DbContextOptions<AppDbContext> options)
IAppDbContext
{
public DbSet<RefreshToken> RefreshTokens => Set<RefreshToken>();
public DbSet<MediaAsset> MediaAssets => Set<MediaAsset>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TeleWave.Domain.Media;
namespace TeleWave.Infrastructure.Persistence.Configurations;
public class MediaAssetConfiguration : IEntityTypeConfiguration<MediaAsset>
{
public void Configure(EntityTypeBuilder<MediaAsset> builder)
{
builder.Property(x => x.OriginalFileName).IsRequired().HasMaxLength(512);
builder.Property(x => x.OriginalExtension).IsRequired().HasMaxLength(16);
builder.Property(x => x.VideoCodec).HasMaxLength(32);
builder.Property(x => x.AudioCodec).HasMaxLength(32);
builder.Property(x => x.RelativePath).HasMaxLength(256);
builder.Property(x => x.ErrorMessage).HasMaxLength(2048);
builder.HasIndex(x => x.Status);
builder.HasIndex(x => x.CreatedAt);
}
}