Files
WatchIt/WatchIt.Common/WatchIt.Common.Model/Media/MediaPhotoRequest.cs

42 lines
1.0 KiB
C#
Raw Normal View History

using System.Diagnostics.CodeAnalysis;
using WatchIt.Common.Model.Photos;
2024-09-25 22:11:28 +02:00
using WatchIt.Database.Model.Media;
2024-07-03 22:18:32 +02:00
namespace WatchIt.Common.Model.Media;
2024-09-25 22:11:28 +02:00
public class MediaPhotoRequest : Photo
2024-07-03 22:18:32 +02:00
{
#region CONSTRUCTORS
public MediaPhotoRequest() {}
[SetsRequiredMembers]
public MediaPhotoRequest(PhotoResponse response)
{
Image = response.Image;
MimeType = response.MimeType;
}
#endregion
#region PUBLIC METHODS
2024-09-25 22:11:28 +02:00
public MediaPhotoImage CreateMediaPhotoImage(long mediaId) => new MediaPhotoImage
2024-07-03 22:18:32 +02:00
{
2024-09-25 22:11:28 +02:00
MediaId = mediaId,
2024-07-03 22:18:32 +02:00
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
};
#endregion
2024-07-03 22:18:32 +02:00
}