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.
43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using Musify.Domain.Abstractions;
|
|
|
|
namespace Musify.Domain.Entities
|
|
{
|
|
#pragma warning disable CS8618
|
|
[Table("Mixes")]
|
|
public class Mix : IAuditable
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
[Required]
|
|
public required long UserId { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(100)]
|
|
public required string Title { get; set; }
|
|
|
|
[MaxLength(256)]
|
|
public string? Subtitle { get; set; }
|
|
|
|
[Required]
|
|
public required DateOnly GeneratedOn { get; set; }
|
|
|
|
[Required]
|
|
public int Position { get; set; } = 0;
|
|
|
|
[Required]
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
[Required]
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
[ForeignKey(nameof(UserId))]
|
|
public User User { get; set; }
|
|
|
|
public ICollection<MixItem> Items { get; set; } = new List<MixItem>();
|
|
}
|
|
}
|