A lot of changes
This commit is contained in:
@@ -26,23 +26,9 @@ namespace Musify.Domain.Entities
|
||||
|
||||
[Required]
|
||||
[MaxLength(256)]
|
||||
public required string Description { get; set; } = "No description was provided.";
|
||||
public string Description { get; set; } = "No description was provided.";
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string OriginalPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string SmallPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string MediumPictureName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public required string LargePictureName { get; set; }
|
||||
public required PlayListPictures Pictures { get; set; }
|
||||
|
||||
[Required]
|
||||
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Musify.Domain.Entities
|
||||
public required string NormalizedTitle { get; set; }
|
||||
|
||||
[Required]
|
||||
public int Duration { get; set; }
|
||||
public int DurationSeconds { get; set; }
|
||||
|
||||
public long? OwnerUserId { get; set; }
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Musify.Domain.Entities
|
||||
|
||||
public TrackAudio Audio { get; set; } = new();
|
||||
|
||||
[ForeignKey(nameof(OwnerUserId))]
|
||||
[ForeignKey(nameof(OwnerUserId)) ]
|
||||
public User? Owner { get; set; }
|
||||
|
||||
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
|
||||
@@ -53,5 +53,8 @@ namespace Musify.Domain.Entities
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,12 @@ namespace Musify.Domain.Entities
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[NotMapped]
|
||||
public bool IsConsumed => Status == UploadIntentStatus.Consumed;
|
||||
|
||||
[NotMapped]
|
||||
public bool IsExpired => Status == UploadIntentStatus.Expired || ExpiresAt < DateTime.UtcNow;
|
||||
|
||||
[ForeignKey(nameof(UserId)) ]
|
||||
public User User { get; set; } = null!;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user