new photos controller created

This commit is contained in:
2024-09-25 22:11:28 +02:00
Unverified
parent bb67186587
commit 9e9e5e1742
36 changed files with 743 additions and 332 deletions

View File

@@ -1,12 +1,13 @@
using WatchIt.Database.Model.Media;
using WatchIt.Common.Model.Photos;
using WatchIt.Database.Model.Media;
namespace WatchIt.Common.Model.Media;
public class MediaPhotoRequest : MediaPhoto
public class MediaPhotoRequest : Photo
{
public MediaPhotoImage CreateMediaPhotoImage() => new MediaPhotoImage
public MediaPhotoImage CreateMediaPhotoImage(long mediaId) => new MediaPhotoImage
{
MediaId = MediaId,
MediaId = mediaId,
Image = Image,
MimeType = MimeType
};
@@ -18,22 +19,4 @@ public class MediaPhotoRequest : MediaPhoto
FirstGradientColor = Background.FirstGradientColor,
SecondGradientColor = Background.SecondGradientColor
};
public void UpdateMediaPhotoImage(MediaPhotoImage item)
{
item.MediaId = MediaId;
item.Image = Image;
item.MimeType = MimeType;
item.UploadDate = DateTime.Now;
}
public void UpdateMediaPhotoImageBackground(MediaPhotoImageBackground item)
{
if (Background is not null)
{
item.IsUniversalBackground = Background.IsUniversalBackground;
item.FirstGradientColor = Background.FirstGradientColor;
item.SecondGradientColor = Background.SecondGradientColor;
}
}
}