MediaEditPage - photos management panel added
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
using WatchIt.Common.Model.Photos;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using WatchIt.Common.Model.Photos;
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Common.Model.Media;
|
||||
|
||||
public class MediaPhotoRequest : Photo
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public MediaPhotoRequest() {}
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public MediaPhotoRequest(PhotoResponse response)
|
||||
{
|
||||
Image = response.Image;
|
||||
MimeType = response.MimeType;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public MediaPhotoImage CreateMediaPhotoImage(long mediaId) => new MediaPhotoImage
|
||||
{
|
||||
MediaId = mediaId,
|
||||
@@ -19,4 +37,6 @@ public class MediaPhotoRequest : Photo
|
||||
FirstGradientColor = Background.FirstGradientColor,
|
||||
SecondGradientColor = Background.SecondGradientColor
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -4,9 +4,4 @@ namespace WatchIt.Common.Model.Media;
|
||||
|
||||
public abstract class MediaPoster : Picture
|
||||
{
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public override string ToString() => $"data:{MimeType};base64,{Convert.ToBase64String(Image)}";
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,9 +1,26 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using WatchIt.Database.Model.Media;
|
||||
|
||||
namespace WatchIt.Common.Model.Photos;
|
||||
|
||||
public class PhotoBackgroundDataRequest : PhotoBackgroundData
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public PhotoBackgroundDataRequest() {}
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public PhotoBackgroundDataRequest(PhotoBackgroundData photoBackgroundData)
|
||||
{
|
||||
IsUniversalBackground = photoBackgroundData.IsUniversalBackground;
|
||||
FirstGradientColor = photoBackgroundData.FirstGradientColor;
|
||||
SecondGradientColor = photoBackgroundData.SecondGradientColor;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public MediaPhotoImageBackground CreateMediaPhotoImageBackground(Guid photoId) => new MediaPhotoImageBackground
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PhotoQueryParameters : QueryParameters<PhotoResponse>
|
||||
&&
|
||||
TestBoolean(item.Background is not null, IsBackground)
|
||||
&&
|
||||
TestBoolean(item.Background!.IsUniversalBackground, IsUniversalBackground)
|
||||
TestBoolean(item.Background is not null && item.Background.IsUniversalBackground, IsUniversalBackground)
|
||||
&&
|
||||
TestComparable(item.UploadDate, UploadDate, UploadDateFrom, UploadDateTo)
|
||||
);
|
||||
|
||||
@@ -13,4 +13,12 @@ public abstract class Picture
|
||||
public required string MimeType { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public override string ToString() => $"data:{MimeType};base64,{Convert.ToBase64String(Image)}";
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user