* add music videos library * add music video tables * first pass at music video library scan * support music videos in playouts * display music videos in search results and collections * fix music video thumbnails * remove some obsolete fields
24 lines
738 B
C#
24 lines
738 B
C#
using ErsatzTV.Core.Domain;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace ErsatzTV.Infrastructure.Data.Configurations
|
|
{
|
|
public class MusicVideoConfiguration : IEntityTypeConfiguration<MusicVideo>
|
|
{
|
|
public void Configure(EntityTypeBuilder<MusicVideo> builder)
|
|
{
|
|
builder.ToTable("MusicVideo");
|
|
|
|
builder.HasMany(m => m.MusicVideoMetadata)
|
|
.WithOne(m => m.MusicVideo)
|
|
.HasForeignKey(m => m.MusicVideoId)
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
builder.HasMany(m => m.MediaVersions)
|
|
.WithOne()
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
}
|
|
}
|
|
}
|