MusicAlbumMetadata.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma warning disable CA2227
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. namespace Jellyfin.Data.Entities.Libraries
  5. {
  6. /// <summary>
  7. /// An entity holding the metadata for a music album.
  8. /// </summary>
  9. public class MusicAlbumMetadata : ItemMetadata
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
  13. /// </summary>
  14. /// <param name="title">The title or name of the album.</param>
  15. /// <param name="language">ISO-639-3 3-character language codes.</param>
  16. /// <param name="album">The music album.</param>
  17. public MusicAlbumMetadata(string title, string language, MusicAlbum album) : base(title, language)
  18. {
  19. Labels = new HashSet<Company>();
  20. album.MusicAlbumMetadata.Add(this);
  21. }
  22. /// <summary>
  23. /// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
  24. /// </summary>
  25. /// <remarks>
  26. /// Default constructor. Protected due to required properties, but present because EF needs it.
  27. /// </remarks>
  28. protected MusicAlbumMetadata()
  29. {
  30. }
  31. /// <summary>
  32. /// Gets or sets the barcode.
  33. /// </summary>
  34. /// <remarks>
  35. /// Max length = 255.
  36. /// </remarks>
  37. [MaxLength(255)]
  38. [StringLength(255)]
  39. public string Barcode { get; set; }
  40. /// <summary>
  41. /// Gets or sets the label number.
  42. /// </summary>
  43. /// <remarks>
  44. /// Max length = 255.
  45. /// </remarks>
  46. [MaxLength(255)]
  47. [StringLength(255)]
  48. public string LabelNumber { get; set; }
  49. /// <summary>
  50. /// Gets or sets the country code.
  51. /// </summary>
  52. /// <remarks>
  53. /// Max length = 2.
  54. /// </remarks>
  55. [MaxLength(2)]
  56. [StringLength(2)]
  57. public string Country { get; set; }
  58. /// <summary>
  59. /// Gets or sets a collection containing the labels.
  60. /// </summary>
  61. public virtual ICollection<Company> Labels { get; protected set; }
  62. }
  63. }