TrackMetadata.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. namespace Jellyfin.Data.Entities
  4. {
  5. public partial class TrackMetadata : Metadata
  6. {
  7. partial void Init();
  8. /// <summary>
  9. /// Default constructor. Protected due to required properties, but present because EF needs it.
  10. /// </summary>
  11. protected TrackMetadata()
  12. {
  13. Init();
  14. }
  15. /// <summary>
  16. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  17. /// </summary>
  18. public static TrackMetadata CreateTrackMetadataUnsafe()
  19. {
  20. return new TrackMetadata();
  21. }
  22. /// <summary>
  23. /// Public constructor with required data.
  24. /// </summary>
  25. /// <param name="title">The title or name of the object.</param>
  26. /// <param name="language">ISO-639-3 3-character language codes.</param>
  27. /// <param name="_track0"></param>
  28. public TrackMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Track _track0)
  29. {
  30. if (string.IsNullOrEmpty(title))
  31. {
  32. throw new ArgumentNullException(nameof(title));
  33. }
  34. this.Title = title;
  35. if (string.IsNullOrEmpty(language))
  36. {
  37. throw new ArgumentNullException(nameof(language));
  38. }
  39. this.Language = language;
  40. if (_track0 == null)
  41. {
  42. throw new ArgumentNullException(nameof(_track0));
  43. }
  44. _track0.TrackMetadata.Add(this);
  45. Init();
  46. }
  47. /// <summary>
  48. /// Static create function (for use in LINQ queries, etc.)
  49. /// </summary>
  50. /// <param name="title">The title or name of the object.</param>
  51. /// <param name="language">ISO-639-3 3-character language codes.</param>
  52. /// <param name="_track0"></param>
  53. public static TrackMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Track _track0)
  54. {
  55. return new TrackMetadata(title, language, dateadded, datemodified, _track0);
  56. }
  57. /*************************************************************************
  58. * Properties
  59. *************************************************************************/
  60. /*************************************************************************
  61. * Navigation properties
  62. *************************************************************************/
  63. }
  64. }