using System; using System.Collections.Generic; using Jellyfin.Data.Interfaces; namespace Jellyfin.Data.Entities.Libraries { /// /// An entity representing a track. /// public class Track : LibraryItem, IHasReleases { /// /// Initializes a new instance of the class. /// /// The album. public Track(MusicAlbum album) { if (album == null) { throw new ArgumentNullException(nameof(album)); } album.Tracks.Add(this); Releases = new HashSet(); TrackMetadata = new HashSet(); } /// /// Initializes a new instance of the class. /// /// /// Default constructor. Protected due to required properties, but present because EF needs it. /// protected Track() { } /// /// Gets or sets the track number. /// public int? TrackNumber { get; set; } /// public virtual ICollection Releases { get; protected set; } /// /// Gets or sets a collection containing the track metadata. /// public virtual ICollection TrackMetadata { get; protected set; } } }