Files
Musify/backend/Musify.Domain/Entities/MixItem.cs
T
Admin 496a5f4a0b feat: recommend server-generated mixes from Musify and YouTube Music
Mixes are their own concept, not playlists: they live in their own
Mixes/MixItems tables, cannot be edited and never show up among the
user's playlists. Each item is either a Musify track or a YouTube Music
reference, so YouTube songs stream directly instead of being downloaded.

A daily Hangfire job seeds the mixes from the listening history: one
discovery mix, one daily mix and one per top artist.

The per-user YouTube filler query was already in the working tree and
rides along here because it shares files with this change.
2026-07-21 18:13:07 +02:00

51 lines
1.2 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Musify.Domain.ValueObjects;
namespace Musify.Domain.Entities
{
#pragma warning disable CS8618
[Table("MixItems")]
public class MixItem
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public required Guid MixId { get; set; }
[Required]
public int Position { get; set; } = 0;
[Required]
public required MixItemSource Source { get; set; }
public Guid? TrackId { get; set; }
[MaxLength(64)]
public string? VideoId { get; set; }
[MaxLength(300)]
public string? Title { get; set; }
[MaxLength(300)]
public string? Artist { get; set; }
[MaxLength(512)]
public string? ThumbnailUrl { get; set; }
[Required]
public int DurationSeconds { get; set; } = 0;
[Required]
public bool IsExplicit { get; set; } = false;
[ForeignKey(nameof(MixId))]
public Mix Mix { get; set; }
[ForeignKey(nameof(TrackId))]
public Track? Track { get; set; }
}
}