Track.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated from a template.
  4. //
  5. // Manual changes to this file may cause unexpected behavior in your application.
  6. // Manual changes to this file will be overwritten if the code is regenerated.
  7. //
  8. // Produced by Entity Framework Visual Editor
  9. // https://github.com/msawczyn/EFDesigner
  10. // </auto-generated>
  11. //------------------------------------------------------------------------------
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Collections.ObjectModel;
  15. using System.ComponentModel;
  16. using System.ComponentModel.DataAnnotations;
  17. using System.ComponentModel.DataAnnotations.Schema;
  18. using System.Linq;
  19. using System.Runtime.CompilerServices;
  20. namespace Jellyfin.Data.Entities
  21. {
  22. public partial class Track: global::Jellyfin.Data.Entities.LibraryItem
  23. {
  24. partial void Init();
  25. /// <summary>
  26. /// Default constructor. Protected due to required properties, but present because EF needs it.
  27. /// </summary>
  28. protected Track(): base()
  29. {
  30. // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
  31. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
  32. Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
  33. TrackMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.TrackMetadata>();
  34. Init();
  35. }
  36. /// <summary>
  37. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  38. /// </summary>
  39. public static Track CreateTrackUnsafe()
  40. {
  41. return new Track();
  42. }
  43. /// <summary>
  44. /// Public constructor with required data
  45. /// </summary>
  46. /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
  47. /// <param name="_musicalbum0"></param>
  48. public Track(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
  49. {
  50. // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
  51. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
  52. this.UrlId = urlid;
  53. if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
  54. _musicalbum0.Tracks.Add(this);
  55. this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
  56. this.TrackMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.TrackMetadata>();
  57. Init();
  58. }
  59. /// <summary>
  60. /// Static create function (for use in LINQ queries, etc.)
  61. /// </summary>
  62. /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
  63. /// <param name="_musicalbum0"></param>
  64. public static Track Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
  65. {
  66. return new Track(urlid, dateadded, _musicalbum0);
  67. }
  68. /*************************************************************************
  69. * Properties
  70. *************************************************************************/
  71. /// <summary>
  72. /// Backing field for TrackNumber
  73. /// </summary>
  74. protected int? _TrackNumber;
  75. /// <summary>
  76. /// When provided in a partial class, allows value of TrackNumber to be changed before setting.
  77. /// </summary>
  78. partial void SetTrackNumber(int? oldValue, ref int? newValue);
  79. /// <summary>
  80. /// When provided in a partial class, allows value of TrackNumber to be changed before returning.
  81. /// </summary>
  82. partial void GetTrackNumber(ref int? result);
  83. public int? TrackNumber
  84. {
  85. get
  86. {
  87. int? value = _TrackNumber;
  88. GetTrackNumber(ref value);
  89. return (_TrackNumber = value);
  90. }
  91. set
  92. {
  93. int? oldValue = _TrackNumber;
  94. SetTrackNumber(oldValue, ref value);
  95. if (oldValue != value)
  96. {
  97. _TrackNumber = value;
  98. }
  99. }
  100. }
  101. /*************************************************************************
  102. * Navigation properties
  103. *************************************************************************/
  104. public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
  105. public virtual ICollection<global::Jellyfin.Data.Entities.TrackMetadata> TrackMetadata { get; protected set; }
  106. }
  107. }