ImageInfo.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace Jellyfin.Data.Entities
  5. {
  6. /// <summary>
  7. /// An entity representing an image.
  8. /// </summary>
  9. public class ImageInfo
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="ImageInfo"/> class.
  13. /// </summary>
  14. /// <param name="path">The path.</param>
  15. public ImageInfo(string path)
  16. {
  17. Path = path;
  18. LastModified = DateTime.UtcNow;
  19. }
  20. /// <summary>
  21. /// Gets the id.
  22. /// </summary>
  23. /// <remarks>
  24. /// Identity, Indexed, Required.
  25. /// </remarks>
  26. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  27. public int Id { get; private set; }
  28. /// <summary>
  29. /// Gets the user id.
  30. /// </summary>
  31. public Guid? UserId { get; private set; }
  32. /// <summary>
  33. /// Gets or sets the path of the image.
  34. /// </summary>
  35. /// <remarks>
  36. /// Required.
  37. /// </remarks>
  38. [MaxLength(512)]
  39. [StringLength(512)]
  40. public string Path { get; set; }
  41. /// <summary>
  42. /// Gets or sets the date last modified.
  43. /// </summary>
  44. /// <remarks>
  45. /// Required.
  46. /// </remarks>
  47. public DateTime LastModified { get; set; }
  48. }
  49. }