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