MusicAlbumMetadata.cs 2.1 KB

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