LANCommander/LANCommander.Server.Data/Models/Media.cs
Pat Hartl 3fe6bea7e5 Added "Preview" edit view, flesh out media picker
- Added sort order to media for screenshots and videos
- Added new "Preview" pane to game editor. Simulates the game details view in the launcher and allows for in-place media upload / grabbing
- Added abstractions for media grabbing
- Added subtitle to media picker dialog to indicate which services provide which assets
- Added preview for videos
- Made media searching faster overall
2026-04-24 02:05:56 -05:00

50 lines
1.4 KiB
C#

using LANCommander.SDK.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace LANCommander.Server.Data.Models
{
[Table("Media")]
public class Media : BaseModel
{
public Guid FileId { get; set; }
[MaxLength(64)]
public string? Name { get; set; }
public MediaType Type { get; set; }
[MaxLength(2048)]
public string? SourceUrl { get; set; }
[MaxLength(255)]
public string? MimeType { get; set; }
[MaxLength(8)]
public string Crc32 { get; set; }
public int SortOrder { get; set; }
public Media? Thumbnail { get; set; }
[JsonIgnore]
public Media? Parent { get; set; }
public Guid StorageLocationId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(StorageLocationId))]
[InverseProperty(nameof(StorageLocation.Media))]
public StorageLocation StorageLocation { get; set; }
public Guid? GameId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(GameId))]
[InverseProperty("Media")]
public Game? Game { get; set; }
public Guid? UserId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(UserId))]
[InverseProperty("Media")]
public User? User { get; set; }
}
}