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.
51 lines
1.2 KiB
C#
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; }
|
|
}
|
|
}
|