add artists as owners of music videos (#154)
* clean up genre, tag, studio orphans * enforce foreign keys at connection level * wip * fix fragment scroll offset * fix see all link for music videos * add fake artist metadata * not null artist id * add artist scanning * remove improperly named music videos * code cleanup * add artists to search results and collections * clean up music video metadata / artist * add artist view * show music videos on artist page * add music video artwork placeholder
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using ErsatzTV.Core.Domain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Data.Configurations
|
||||
{
|
||||
public class ArtistConfiguration : IEntityTypeConfiguration<Artist>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Artist> builder)
|
||||
{
|
||||
builder.ToTable("Artist");
|
||||
|
||||
builder.HasMany(a => a.MusicVideos)
|
||||
.WithOne(mv => mv.Artist)
|
||||
.HasForeignKey(mv => mv.ArtistId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder.HasMany(a => a.ArtistMetadata)
|
||||
.WithOne(am => am.Artist)
|
||||
.HasForeignKey(am => am.ArtistId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user