jellyfin/Jellyfin.Data/Entities/Libraries/MusicAlbumMetadata.cs

72 lines
2.1 KiB
C#
Raw Normal View History

2020-09-01 15:36:45 +00:00
#pragma warning disable CA2227
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
2020-08-29 17:30:09 +00:00
namespace Jellyfin.Data.Entities.Libraries
{
/// <summary>
/// An entity holding the metadata for a music album.
/// </summary>
2020-09-01 15:38:09 +00:00
public class MusicAlbumMetadata : ItemMetadata
2020-05-02 21:56:05 +00:00
{
/// <summary>
/// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
2020-05-02 21:56:05 +00:00
/// </summary>
/// <param name="title">The title or name of the album.</param>
2020-06-19 10:21:49 +00:00
/// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="album">The music album.</param>
public MusicAlbumMetadata(string title, string language, MusicAlbum album) : base(title, language)
2020-05-02 21:56:05 +00:00
{
Labels = new HashSet<Company>();
2020-05-02 21:56:05 +00:00
album.MusicAlbumMetadata.Add(this);
2020-05-02 21:56:05 +00:00
}
/// <summary>
/// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
2020-05-02 21:56:05 +00:00
/// </summary>
/// <remarks>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </remarks>
protected MusicAlbumMetadata()
2020-05-02 21:56:05 +00:00
{
}
/// <summary>
/// Gets or sets the barcode.
2020-05-02 21:56:05 +00:00
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
2020-05-02 21:56:05 +00:00
[MaxLength(255)]
[StringLength(255)]
public string Barcode { get; set; }
2020-06-15 21:43:52 +00:00
2020-05-02 21:56:05 +00:00
/// <summary>
/// Gets or sets the label number.
2020-05-02 21:56:05 +00:00
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
2020-05-02 21:56:05 +00:00
[MaxLength(255)]
[StringLength(255)]
public string LabelNumber { get; set; }
2020-05-02 21:56:05 +00:00
/// <summary>
/// Gets or sets the country code.
2020-05-02 21:56:05 +00:00
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
2020-05-02 21:56:05 +00:00
[MaxLength(2)]
[StringLength(2)]
public string Country { get; set; }
/// <summary>
/// Gets or sets a collection containing the labels.
/// </summary>
2020-05-02 21:56:05 +00:00
public virtual ICollection<Company> Labels { get; protected set; }
}
}