// <copyright file="AudioStreamDetailsConfiguration.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace Jellyfin.Database.Implementations.ModelConfiguration;

using System;
using Jellyfin.Database.Implementations.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

/// <summary>
/// EF Core configuration for <see cref="AudioStreamDetails"/>.
/// </summary>
public class AudioStreamDetailsConfiguration : IEntityTypeConfiguration<AudioStreamDetails>
{
    /// <inheritdoc/>
    public void Configure(EntityTypeBuilder<AudioStreamDetails> builder)
    {
        ArgumentNullException.ThrowIfNull(builder);
        builder.HasKey(e => new { e.ItemId, e.StreamIndex });
        builder.ToTable("audio_stream_details", "library");
    }
}
