TrackMetadata.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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)) throw new ArgumentNullException(nameof(title));
  31. this.Title = title;
  32. if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
  33. this.Language = language;
  34. if (_track0 == null) throw new ArgumentNullException(nameof(_track0));
  35. _track0.TrackMetadata.Add(this);
  36. Init();
  37. }
  38. /// <summary>
  39. /// Static create function (for use in LINQ queries, etc.)
  40. /// </summary>
  41. /// <param name="title">The title or name of the object</param>
  42. /// <param name="language">ISO-639-3 3-character language codes</param>
  43. /// <param name="_track0"></param>
  44. public static TrackMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Track _track0)
  45. {
  46. return new TrackMetadata(title, language, dateadded, datemodified, _track0);
  47. }
  48. /*************************************************************************
  49. * Properties
  50. *************************************************************************/
  51. /*************************************************************************
  52. * Navigation properties
  53. *************************************************************************/
  54. }
  55. }