2
0

UserData.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. namespace Jellyfin.Data.Entities;
  4. /// <summary>
  5. /// Provides <see cref="BaseItemEntity"/> and <see cref="User"/> related data.
  6. /// </summary>
  7. public class UserData
  8. {
  9. /// <summary>
  10. /// Gets or sets the custom data key.
  11. /// </summary>
  12. /// <value>The rating.</value>
  13. public required string CustomDataKey { get; set; }
  14. /// <summary>
  15. /// Gets or sets the users 0-10 rating.
  16. /// </summary>
  17. /// <value>The rating.</value>
  18. public double? Rating { get; set; }
  19. /// <summary>
  20. /// Gets or sets the playback position ticks.
  21. /// </summary>
  22. /// <value>The playback position ticks.</value>
  23. public long PlaybackPositionTicks { get; set; }
  24. /// <summary>
  25. /// Gets or sets the play count.
  26. /// </summary>
  27. /// <value>The play count.</value>
  28. public int PlayCount { get; set; }
  29. /// <summary>
  30. /// Gets or sets a value indicating whether this instance is favorite.
  31. /// </summary>
  32. /// <value><c>true</c> if this instance is favorite; otherwise, <c>false</c>.</value>
  33. public bool IsFavorite { get; set; }
  34. /// <summary>
  35. /// Gets or sets the last played date.
  36. /// </summary>
  37. /// <value>The last played date.</value>
  38. public DateTime? LastPlayedDate { get; set; }
  39. /// <summary>
  40. /// Gets or sets a value indicating whether this <see cref="UserData" /> is played.
  41. /// </summary>
  42. /// <value><c>true</c> if played; otherwise, <c>false</c>.</value>
  43. public bool Played { get; set; }
  44. /// <summary>
  45. /// Gets or sets the index of the audio stream.
  46. /// </summary>
  47. /// <value>The index of the audio stream.</value>
  48. public int? AudioStreamIndex { get; set; }
  49. /// <summary>
  50. /// Gets or sets the index of the subtitle stream.
  51. /// </summary>
  52. /// <value>The index of the subtitle stream.</value>
  53. public int? SubtitleStreamIndex { get; set; }
  54. /// <summary>
  55. /// Gets or sets a value indicating whether the item is liked or not.
  56. /// This should never be serialized.
  57. /// </summary>
  58. /// <value><c>null</c> if [likes] contains no value, <c>true</c> if [likes]; otherwise, <c>false</c>.</value>
  59. public bool? Likes { get; set; }
  60. /// <summary>
  61. /// Gets or sets the key.
  62. /// </summary>
  63. /// <value>The key.</value>
  64. public required Guid ItemId { get; set; }
  65. /// <summary>
  66. /// Gets or Sets the BaseItem.
  67. /// </summary>
  68. public required BaseItemEntity? Item { get; set; }
  69. /// <summary>
  70. /// Gets or Sets the UserId.
  71. /// </summary>
  72. public required Guid UserId { get; set; }
  73. /// <summary>
  74. /// Gets or Sets the User.
  75. /// </summary>
  76. public required User? User { get; set; }
  77. }