feat: MovieDto enrichment, movie detail page, PWA, watchlist, watchlist federation
This commit is contained in:
@@ -14,6 +14,10 @@ pub mod import_session;
|
||||
pub mod import_profile;
|
||||
pub mod person;
|
||||
pub mod search;
|
||||
pub mod watchlist;
|
||||
pub use watchlist::{WatchlistEntry, WatchlistWithMovie};
|
||||
pub mod remote_watchlist;
|
||||
pub use remote_watchlist::RemoteWatchlistEntry;
|
||||
|
||||
pub use import::{
|
||||
AnnotatedRow, DomainField, FieldMapping, FileFormat, ImportError,
|
||||
@@ -45,6 +49,23 @@ pub struct DiaryFilter {
|
||||
pub search: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MovieFilter {
|
||||
pub search: Option<String>,
|
||||
pub genre: Option<String>,
|
||||
pub language: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MovieSummary {
|
||||
pub movie: Movie,
|
||||
pub genres: Vec<String>,
|
||||
pub runtime_minutes: Option<u32>,
|
||||
pub original_language: Option<String>,
|
||||
pub overview: Option<String>,
|
||||
pub collection_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Movie {
|
||||
id: MovieId,
|
||||
@@ -133,18 +154,13 @@ impl Movie {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub enum ReviewSource {
|
||||
#[default]
|
||||
Local,
|
||||
Remote { actor_url: String },
|
||||
}
|
||||
|
||||
impl Default for ReviewSource {
|
||||
fn default() -> Self {
|
||||
ReviewSource::Local
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Review {
|
||||
id: ReviewId,
|
||||
|
||||
12
crates/domain/src/models/remote_watchlist.rs
Normal file
12
crates/domain/src/models/remote_watchlist.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RemoteWatchlistEntry {
|
||||
pub ap_id: String,
|
||||
pub actor_url: String,
|
||||
pub movie_title: String,
|
||||
pub release_year: u16,
|
||||
pub external_metadata_id: Option<String>,
|
||||
pub poster_url: Option<String>,
|
||||
pub added_at: DateTime<Utc>,
|
||||
}
|
||||
31
crates/domain/src/models/watchlist.rs
Normal file
31
crates/domain/src/models/watchlist.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use chrono::{NaiveDateTime, Utc};
|
||||
|
||||
use crate::{
|
||||
models::Movie,
|
||||
value_objects::{MovieId, UserId, WatchlistEntryId},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WatchlistEntry {
|
||||
pub id: WatchlistEntryId,
|
||||
pub user_id: UserId,
|
||||
pub movie_id: MovieId,
|
||||
pub added_at: NaiveDateTime,
|
||||
}
|
||||
|
||||
impl WatchlistEntry {
|
||||
pub fn new(user_id: UserId, movie_id: MovieId) -> Self {
|
||||
Self {
|
||||
id: WatchlistEntryId::generate(),
|
||||
user_id,
|
||||
movie_id,
|
||||
added_at: Utc::now().naive_utc(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WatchlistWithMovie {
|
||||
pub entry: WatchlistEntry,
|
||||
pub movie: Movie,
|
||||
}
|
||||
Reference in New Issue
Block a user