feat: 支持使用动态 api 获取投稿,该 api 会返回动态视频 (#485)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-10-10 18:52:07 +08:00
committed by GitHub
parent 4d6669a48a
commit ed54ca13b8
20 changed files with 348 additions and 47 deletions
+2
View File
@@ -9,6 +9,7 @@ mod m20250612_090826_add_enabled;
mod m20250613_043257_add_config;
mod m20250712_080013_add_video_created_at_index;
mod m20250903_094454_add_rule_and_should_download;
mod m20251009_123713_add_use_dynamic_api;
pub struct Migrator;
@@ -25,6 +26,7 @@ impl MigratorTrait for Migrator {
Box::new(m20250613_043257_add_config::Migration),
Box::new(m20250712_080013_add_video_created_at_index::Migration),
Box::new(m20250903_094454_add_rule_and_should_download::Migration),
Box::new(m20251009_123713_add_use_dynamic_api::Migration),
]
}
}
@@ -0,0 +1,36 @@
use sea_orm_migration::prelude::*;
use sea_orm_migration::schema::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Submission::Table)
.add_column(boolean(Submission::UseDynamicApi).default(false))
.to_owned(),
)
.await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Submission::Table)
.drop_column(Submission::UseDynamicApi)
.to_owned(),
)
.await
}
}
#[derive(DeriveIden)]
enum Submission {
Table,
UseDynamicApi,
}