This commit is contained in:
2026-07-18 23:29:57 +02:00
parent 4fed9bd059
commit 2dc544b2c0
109 changed files with 5134 additions and 2163 deletions
+2 -19
View File
@@ -1,12 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Musify.Domain.Abstractions;
using Musify.Domain.ValueObjects;
namespace Musify.Domain.Entities
{
#pragma warning disable CS8618
public class Track : IAuditable
public abstract class Track : IAuditable
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
@@ -22,14 +21,6 @@ namespace Musify.Domain.Entities
[Required]
public int DurationSeconds { get; set; }
public long? OwnerUserId { get; set; }
[Required]
public TrackSource Source { get; set; } = TrackSource.Local;
[MaxLength(16)]
public string? ExternalId { get; set; }
[Required]
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
@@ -43,18 +34,10 @@ namespace Musify.Domain.Entities
public TrackAudio Audio { get; set; } = new();
[ForeignKey(nameof(OwnerUserId)) ]
public User? Owner { get; set; }
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
public ICollection<PlayListHasTrack> PlayListTracks { get; set; } = new List<PlayListHasTrack>();
public ICollection<ListeningHistory> ListeningHistories { get; set; } = new List<ListeningHistory>();
public ICollection<TrackArtist> TrackArtists { get; set; } = new List<TrackArtist>();
[NotMapped]
public bool IsExternal => Source != TrackSource.Local;
}
}
}