feat: watchlist add accepts title/year/imdb for movies not in DB

This commit is contained in:
2026-06-04 02:47:55 +02:00
parent e7cdbf9ca7
commit cf2f4a1b4f
2 changed files with 12 additions and 5 deletions

View File

@@ -20,7 +20,14 @@ pub struct WatchlistResponse {
#[derive(Debug, Clone, Deserialize, utoipa::ToSchema)] #[derive(Debug, Clone, Deserialize, utoipa::ToSchema)]
pub struct AddToWatchlistRequest { pub struct AddToWatchlistRequest {
pub movie_id: Uuid, #[serde(skip_serializing_if = "Option::is_none")]
pub movie_id: Option<Uuid>,
#[serde(skip_serializing_if = "Option::is_none")]
pub external_metadata_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub manual_title: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub manual_release_year: Option<u16>,
} }
#[derive(Debug, Clone, Serialize, utoipa::ToSchema)] #[derive(Debug, Clone, Serialize, utoipa::ToSchema)]

View File

@@ -1411,10 +1411,10 @@ pub async fn post_watchlist_add(
AddToWatchlistCommand { AddToWatchlistCommand {
user_id: user.0.value(), user_id: user.0.value(),
input: MovieInput { input: MovieInput {
movie_id: Some(req.movie_id), movie_id: req.movie_id,
external_metadata_id: None, external_metadata_id: req.external_metadata_id,
manual_title: None, manual_title: req.manual_title,
manual_release_year: None, manual_release_year: req.manual_release_year,
manual_director: None, manual_director: None,
}, },
}, },