2026-09-24 19:23:54 +02:00
|
|
|
namespace GhostImageManager.Models;
|
|
|
|
|
|
|
|
|
|
public class GhostImage
|
|
|
|
|
{
|
2026-09-28 19:09:09 +02:00
|
|
|
public int? ManagedImageId { get; set; }
|
2026-09-24 19:23:54 +02:00
|
|
|
public string Url { get; set; } = "";
|
|
|
|
|
public string FileName { get; set; } = "";
|
|
|
|
|
public string RelativePath { get; set; } = "";
|
|
|
|
|
public string FilePath { get; set; } = "";
|
|
|
|
|
public long FileSize { get; set; }
|
|
|
|
|
public DateTime LastModified { get; set; }
|
|
|
|
|
public int Width { get; set; }
|
|
|
|
|
public int Height { get; set; }
|
|
|
|
|
public bool IsOrphaned { get; set; } = true;
|
|
|
|
|
public List<PostReference> UsedInPosts { get; set; } = new();
|
|
|
|
|
|
2026-09-28 19:09:09 +02:00
|
|
|
// Aus der Datenbank
|
|
|
|
|
public string? AuthorId { get; set; }
|
|
|
|
|
public string? AuthorName { get; set; }
|
|
|
|
|
public string? Theme { get; set; }
|
|
|
|
|
public DateTime? CaptureDate { get; set; }
|
|
|
|
|
|
|
|
|
|
// EXIF
|
|
|
|
|
public string? CameraMake { get; set; }
|
|
|
|
|
public string? CameraModel { get; set; }
|
|
|
|
|
public string? Lens { get; set; }
|
|
|
|
|
public string? Aperture { get; set; }
|
|
|
|
|
public string? ShutterSpeed { get; set; }
|
|
|
|
|
public string? Iso { get; set; }
|
|
|
|
|
public string? FocalLength { get; set; }
|
|
|
|
|
|
2026-09-24 19:23:54 +02:00
|
|
|
public string FormattedFileSize => FileSize switch
|
|
|
|
|
{
|
|
|
|
|
>= 1024 * 1024 => $"{FileSize / (1024.0 * 1024.0):F2} MB",
|
|
|
|
|
>= 1024 => $"{FileSize / 1024.0:F2} KB",
|
|
|
|
|
_ => $"{FileSize} B"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public string Dimensions => Width > 0 && Height > 0 ? $"{Width}x{Height}" : "n/a";
|
2026-09-28 19:09:09 +02:00
|
|
|
|
|
|
|
|
public string CameraDisplay => string.IsNullOrEmpty(CameraModel)
|
|
|
|
|
? "n/a"
|
|
|
|
|
: $"{CameraMake} {CameraModel}".Trim();
|
|
|
|
|
|
|
|
|
|
public string ExifSummary => $"{Aperture ?? "-"} | {ShutterSpeed ?? "-"} | ISO {Iso ?? "-"} | {FocalLength ?? "-"}";
|
2026-09-24 19:23:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PostReference
|
|
|
|
|
{
|
|
|
|
|
public string PostId { get; set; } = "";
|
|
|
|
|
public string Title { get; set; } = "";
|
|
|
|
|
public string Slug { get; set; } = "";
|
|
|
|
|
public bool IsFeatureImage { get; set; }
|
|
|
|
|
public bool IsInContent { get; set; }
|
|
|
|
|
}
|