This commit is contained in:
2024-07-03 22:18:32 +02:00
Unverified
parent 4b333878b8
commit 008dcdf4ec
88 changed files with 3389 additions and 644 deletions

View File

@@ -0,0 +1,38 @@
using WatchIt.Database.Model.Media;
namespace WatchIt.Common.Model.Media;
public class MediaPhotoRequest : MediaPhoto
{
public MediaPhotoImage CreateMediaPhotoImage() => new MediaPhotoImage
{
MediaId = MediaId,
Image = Image,
MimeType = MimeType
};
public MediaPhotoImageBackground? CreateMediaPhotoImageBackground(Guid mediaPhotoImageId) => Background is null ? null : new MediaPhotoImageBackground
{
Id = mediaPhotoImageId,
IsUniversalBackground = Background.IsUniversalBackground,
FirstGradientColor = Background.FirstGradientColor,
SecondGradientColor = Background.SecondGradientColor
};
public void UpdateMediaPhotoImage(MediaPhotoImage item)
{
item.MediaId = MediaId;
item.Image = Image;
item.MimeType = MimeType;
}
public void UpdateMediaPhotoImageBackground(MediaPhotoImageBackground item)
{
if (Background is not null)
{
item.IsUniversalBackground = Background.IsUniversalBackground;
item.FirstGradientColor = Background.FirstGradientColor;
item.SecondGradientColor = Background.SecondGradientColor;
}
}
}