tango_core/entities/
channel.rs1use sea_orm::entity::prelude::*;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
5#[sea_orm(table_name = "channels")]
6pub struct Model {
7 #[sea_orm(primary_key, auto_increment = false)]
8 pub id: String,
9 pub handle: Option<String>,
10 pub description: Option<String>,
11 pub uploads_playlist_id: Option<String>,
12 pub title: Option<String>,
13 pub thumbnail_url: Option<String>,
14 #[sea_orm(column_type = "JsonBinary", nullable)]
15 pub thumbnails: Option<serde_json::Value>,
16 pub subscriber_count: Option<i64>,
17 pub video_count: Option<i64>,
18 pub view_count: Option<i64>,
19 pub hidden_subscriber_count: Option<bool>,
20 pub stats_refreshed_at: Option<DateTimeWithTimeZone>,
21 pub created_at: DateTimeWithTimeZone,
22 pub updated_at: DateTimeWithTimeZone,
23 pub last_full_sync_at: Option<DateTimeWithTimeZone>,
24 pub last_full_sync_filter: Option<String>,
29 pub latest_published_at: Option<DateTimeWithTimeZone>,
30 pub harvest_page_token: Option<String>,
33 #[sea_orm(column_type = "Text")]
37 pub status: String,
38 pub membership_open: bool,
40 #[sea_orm(column_type = "JsonBinary", nullable)]
42 pub links: Option<serde_json::Value>,
43}
44
45#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
46pub enum Relation {
47 #[sea_orm(has_many = "super::video::Entity")]
48 Video,
49}
50
51impl Related<super::video::Entity> for Entity {
52 fn to() -> RelationDef {
53 Relation::Video.def() }
55}
56
57impl ActiveModelBehavior for ActiveModel {}