You've already forked flix
Model refinement
This commit is contained in:
@@ -27,7 +27,7 @@ pub struct Model {
|
||||
/// The season's directory
|
||||
pub directory: PathBytes,
|
||||
/// The season's poster path
|
||||
pub relative_poster_path: Option<PathBytes>,
|
||||
pub relative_poster_path: Option<String>,
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
@@ -44,6 +44,24 @@ pub enum Relation {
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
Library,
|
||||
/// The media info for this show
|
||||
#[sea_orm(
|
||||
belongs_to = "super::super::info::seasons::Entity",
|
||||
from = "(Column::Show, Column::Season)",
|
||||
to = "(super::super::info::seasons::Column::Show, super::super::info::seasons::Column::Season)",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
MediaInfo,
|
||||
/// The watched info for this show
|
||||
#[sea_orm(
|
||||
belongs_to = "super::super::watched::seasons::Entity",
|
||||
from = "(Column::Show, Column::Season)",
|
||||
to = "(super::super::watched::seasons::Column::Show, super::super::watched::seasons::Column::Season)",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
WatchInfo,
|
||||
}
|
||||
|
||||
impl Related<super::libraries::Entity> for Entity {
|
||||
@@ -51,3 +69,15 @@ impl Related<super::libraries::Entity> for Entity {
|
||||
Relation::Library.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::super::info::seasons::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::MediaInfo.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::super::watched::seasons::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::WatchInfo.def()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user