2020-09-01 06:35:12 -07:00
|
|
|
|
using System;
|
2020-05-12 19:10:35 -07:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2020-05-19 19:12:03 -07:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2020-05-12 19:10:35 -07:00
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Data.Entities
|
|
|
|
|
{
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// An entity representing an image.
|
|
|
|
|
/// </summary>
|
2020-05-12 19:10:35 -07:00
|
|
|
|
public class ImageInfo
|
|
|
|
|
{
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="ImageInfo"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">The path.</param>
|
2020-05-20 09:09:52 -07:00
|
|
|
|
public ImageInfo(string path)
|
2020-05-12 19:10:35 -07:00
|
|
|
|
{
|
|
|
|
|
Path = path;
|
|
|
|
|
LastModified = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="ImageInfo"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Default constructor. Protected due to required properties, but present because EF needs it.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
protected ImageInfo()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Identity, Indexed, Required.
|
|
|
|
|
/// </remarks>
|
2020-05-19 19:12:03 -07:00
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
2020-05-12 19:10:35 -07:00
|
|
|
|
public int Id { get; protected set; }
|
|
|
|
|
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the user id.
|
|
|
|
|
/// </summary>
|
2020-06-13 13:38:17 -07:00
|
|
|
|
public Guid? UserId { get; protected set; }
|
|
|
|
|
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the path of the image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-05-12 19:10:35 -07:00
|
|
|
|
[Required]
|
2020-05-20 09:09:52 -07:00
|
|
|
|
[MaxLength(512)]
|
|
|
|
|
[StringLength(512)]
|
2020-05-12 19:10:35 -07:00
|
|
|
|
public string Path { get; set; }
|
|
|
|
|
|
2020-09-01 06:35:12 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the date last modified.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Required.
|
|
|
|
|
/// </remarks>
|
2020-05-12 19:10:35 -07:00
|
|
|
|
public DateTime LastModified { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|