Video support

This commit is contained in:
Bad Manners 2025-04-12 11:42:05 -03:00
parent 4960527af3
commit c650c27825
14 changed files with 310 additions and 57 deletions

View file

@ -86,7 +86,14 @@ impl MigrationTrait for Migration {
.col(string_len(SameyPost::Media, 255))
.col(integer(SameyPost::Width))
.col(integer(SameyPost::Height))
.col(enumeration(
SameyPost::MediaType,
MediaType::Enum,
[MediaType::Image, MediaType::Video],
))
.col(string_len(SameyPost::Thumbnail, 255))
.col(integer(SameyPost::ThumbnailWidth))
.col(integer(SameyPost::ThumbnailHeight))
.col(string_len_null(SameyPost::Title, 100))
.col(text_null(SameyPost::Description))
.col(boolean(SameyPost::IsPublic).default(false))
@ -291,7 +298,10 @@ enum SameyPost {
Media,
Width,
Height,
MediaType,
Thumbnail,
ThumbnailWidth,
ThumbnailHeight,
Title,
Description,
IsPublic,
@ -300,6 +310,17 @@ enum SameyPost {
ParentId,
}
#[derive(DeriveIden)]
#[sea_orm(enum_name = "media_type")]
pub enum MediaType {
#[sea_orm(iden = "media_type")]
Enum,
#[sea_orm(iden = "image")]
Image,
#[sea_orm(iden = "video")]
Video,
}
#[derive(DeriveIden)]
#[sea_orm(enum_name = "rating")]
pub enum Rating {