diff --git a/.gitignore b/.gitignore index 7d02347b..5f5e1a66 100644 --- a/.gitignore +++ b/.gitignore @@ -263,7 +263,7 @@ __pycache__/ # Media folder + app_data App_Data/ -**/Media/ +wwwroot/Media/ Temp/ **/Assets/app.* deps/*.dll \ No newline at end of file diff --git a/unjo.Core/Entities/Media/Media.cs b/unjo.Core/Entities/Media/Media.cs new file mode 100644 index 00000000..a74b29f1 --- /dev/null +++ b/unjo.Core/Entities/Media/Media.cs @@ -0,0 +1,40 @@ +using System; + +namespace unjo.Core.Entities +{ + /// + /// A media file (can contain an image or other media like videos and documents) + /// + public class Media : DatabaseEntity + { + /// + /// Alternative text which is used when the image can't be loaded + /// + public string AlternativeText { get; set; } + + /// + /// Additional caption text + /// + public string Caption { get; set; } + + /// + /// Path of the media item + /// + public string Source { get; set; } + + /// + /// Filesize in bytes + /// + public int Size { get; set; } + + /// + /// Time the file has last changed + /// + public DateTimeOffset LastModifiedDate { get; set; } + + /// + /// Optional focal point for an image + /// + public MediaFocalPoint FocalPoint { get; set; } + } +} diff --git a/unjo.Core/Entities/Media/MediaFocalPoint.cs b/unjo.Core/Entities/Media/MediaFocalPoint.cs new file mode 100644 index 00000000..cb4ca469 --- /dev/null +++ b/unjo.Core/Entities/Media/MediaFocalPoint.cs @@ -0,0 +1,12 @@ +namespace unjo.Core.Entities +{ + /// + /// The focal point sets the point of interest in an image with x/y coordinates from 0-1 + /// + public class MediaFocalPoint + { + public decimal Left { get; set; } + + public decimal Top { get; set; } + } +}