Files
Musify/Musify.Domain/Entities/Track.cs
T
AdminandClaude Opus 4.8 f6d668d201 refactor: standardize project names to Musify.* and flatten layout
- Flatten nested per-repo folders into flat Musify.* projects at root
- Rename assemblies/csproj: Domain->Musify.Domain, Application->Musify.Application,
  Infrastructure->Musify.Infrastructure, WebApi->Musify.Api, Worker->Musify.Worker,
  StreamingGateway->Musify.StreamingGateway
- Rename WebApi.* namespaces to Musify.Api.*
- Update all ProjectReference paths and the solution file
- Consolidate stray per-repo dotfiles; add root .gitattributes
- Move flutter client out to _archive

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 03:32:48 +02:00

78 lines
2.4 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.CodeAnalysis;
using Musify.Domain.Abstractions;
using Musify.Domain.ValueObjects;
namespace Musify.Domain.Entities
{
#pragma warning disable CS8618
public class Track : IAuditable
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(50)]
public required string Title { get; set; }
[Required]
[MaxLength(50)]
public required string NormalizedTitle { get; set; }
[Required]
[MaxLength(64)]
public required string OriginalPictureName { get; set; }
[MaxLength(64)]
public string? SmallPictureName { get; set; }
[MaxLength(64)]
public string? MediumPictureName { get; set; }
[MaxLength(64)]
public string? LargePictureName { get; set; }
[Required]
[MaxLength(64)]
public required string OriginalAudioName { get; set; }
[MaxLength(64)]
public string? AudioFolderName { get; set; }
[Required]
public ProcessingStatus PicturesProcessingStatus { get; set; } = ProcessingStatus.Pending;
[Required]
public ProcessingStatus AudioTranscodeProcessingStatus { get; set; } = ProcessingStatus.Pending;
[Required]
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
[Required]
public int RetryCount { get; set; } = 0;
public DateTime? LastRetryAt { get; set; }
[Required]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
[Required]
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public ICollection<UserHasTrack> UserTracks { get; set; } = new List<UserHasTrack>();
public ICollection<PlayListHasTrack> PlayListTracks { get; set; } = new List<PlayListHasTrack>();
[NotMapped]
[MemberNotNullWhen(true, nameof(SmallPictureName)) ]
[MemberNotNullWhen(true, nameof(MediumPictureName)) ]
[MemberNotNullWhen(true, nameof(LargePictureName)) ]
public bool IsPicturesProcessed => PicturesProcessingStatus == ProcessingStatus.Completed;
[NotMapped]
[MemberNotNullWhen(true, nameof(AudioFolderName)) ]
public bool IsAudioProcessed => AudioTranscodeProcessingStatus == ProcessingStatus.Completed;
}
}