restructure
This commit is contained in:
20
crates/domain/src/models/federation.rs
Normal file
20
crates/domain/src/models/federation.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct RemoteActorInfo {
|
||||
pub url: String,
|
||||
pub handle: String,
|
||||
pub display_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PendingFollowerInfo {
|
||||
pub url: String,
|
||||
pub handle: String,
|
||||
pub display_name: Option<String>,
|
||||
pub avatar_url: Option<String>,
|
||||
}
|
||||
|
||||
pub struct FederationFlags {
|
||||
pub goals: bool,
|
||||
pub reviews: bool,
|
||||
pub watchlist: bool,
|
||||
}
|
||||
@@ -3,6 +3,33 @@ use super::{
|
||||
review::{DiaryEntry, Review},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq)]
|
||||
pub enum FeedSortBy {
|
||||
#[default]
|
||||
Date,
|
||||
DateAsc,
|
||||
Rating,
|
||||
RatingAsc,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for FeedSortBy {
|
||||
type Err = std::convert::Infallible;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(match s {
|
||||
"date_asc" => Self::DateAsc,
|
||||
"rating" => Self::Rating,
|
||||
"rating_asc" => Self::RatingAsc,
|
||||
_ => Self::Date,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct FollowingFilter {
|
||||
pub local_user_ids: Vec<uuid::Uuid>,
|
||||
pub remote_actor_urls: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FeedEntry {
|
||||
entry: DiaryEntry,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
mod enrichment;
|
||||
mod federation;
|
||||
mod feed;
|
||||
mod movie;
|
||||
mod refresh_session;
|
||||
@@ -21,6 +22,7 @@ pub mod watchlist;
|
||||
pub mod wrapup;
|
||||
|
||||
pub use enrichment::*;
|
||||
pub use federation::*;
|
||||
pub use feed::*;
|
||||
pub use movie::*;
|
||||
pub use review::*;
|
||||
@@ -47,7 +49,7 @@ pub use import_session::ImportSession;
|
||||
pub use person::{
|
||||
CastCredit, CrewCredit, ExternalPersonId, Person, PersonCredits, PersonEnrichmentData, PersonId,
|
||||
};
|
||||
pub use refresh_session::RefreshSession;
|
||||
pub use refresh_session::{GeneratedToken, RefreshSession};
|
||||
pub use search::{
|
||||
EntityType, IndexableDocument, MovieSearchHit, PersonSearchHit, SearchFilters, SearchQuery,
|
||||
SearchResults,
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
use crate::value_objects::{ExternalMetadataId, MovieId, MovieTitle, PosterPath, ReleaseYear};
|
||||
|
||||
pub enum MetadataSearchCriteria {
|
||||
ImdbId(ExternalMetadataId),
|
||||
Title {
|
||||
title: MovieTitle,
|
||||
year: Option<ReleaseYear>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct MovieFilter {
|
||||
pub search: Option<String>,
|
||||
|
||||
@@ -3,6 +3,11 @@ use uuid::Uuid;
|
||||
|
||||
use crate::value_objects::UserId;
|
||||
|
||||
pub struct GeneratedToken {
|
||||
pub token: String,
|
||||
pub expires_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RefreshSession {
|
||||
pub id: Uuid,
|
||||
|
||||
@@ -4,6 +4,25 @@ use uuid::Uuid;
|
||||
|
||||
use crate::value_objects::WrapUpId;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WrapUpMovieRow {
|
||||
pub movie_id: Uuid,
|
||||
pub title: String,
|
||||
pub release_year: u16,
|
||||
pub director: Option<String>,
|
||||
pub poster_path: Option<String>,
|
||||
pub rating: u8,
|
||||
pub watched_at: NaiveDateTime,
|
||||
pub user_id: Uuid,
|
||||
pub runtime_minutes: Option<u32>,
|
||||
pub budget_usd: Option<i64>,
|
||||
pub original_language: Option<String>,
|
||||
pub genres: Vec<String>,
|
||||
pub keywords: Vec<String>,
|
||||
pub cast_names: Vec<(String, u32, i64)>,
|
||||
pub cast_profile_paths: Vec<Option<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct DateRange {
|
||||
start: NaiveDate,
|
||||
|
||||
Reference in New Issue
Block a user