refactor(web): drop cast from title detail
DESIGN.md §9.6 no longer carries cast (#163). Removes the cast sections, the MetadataCastMember schema and field from both metadata responses, and every .cast-* rule. arr-meta keeps CastMember and the credits append; the TMDB call is unchanged.
This commit is contained in:
@@ -25,7 +25,7 @@ use utoipa_axum::routes;
|
||||
use utoipa_scalar::{Scalar, Servable};
|
||||
|
||||
pub use health::{Check, Health, HealthReport, Status};
|
||||
pub use metadata::{MetadataCastMember, MetadataTrailer, MovieMetadata, SeriesMetadata};
|
||||
pub use metadata::{MetadataTrailer, MovieMetadata, SeriesMetadata};
|
||||
pub use movies::{
|
||||
Accepted, AttentionQueues, CreateMovie, ErrorBody, Movie, MovieFile, Release, UpdateMovie,
|
||||
};
|
||||
|
||||
@@ -13,18 +13,6 @@ use crate::movies::{pool, ApiError, ErrorBody};
|
||||
use crate::search::{tmdb_client, upstream_error};
|
||||
use crate::state::AppState;
|
||||
|
||||
/// One of the top-billed cast members on a detail page.
|
||||
#[derive(Debug, Clone, Serialize, ToSchema)]
|
||||
pub struct MetadataCastMember {
|
||||
/// The person's TMDB id, for the link out to tmdb.org (§9.6).
|
||||
pub tmdb_id: u32,
|
||||
pub name: String,
|
||||
pub character: String,
|
||||
/// Path fragment exactly as TMDB sends it (§9.6): the browser composes
|
||||
/// the URL and picks the size.
|
||||
pub profile_path: Option<String>,
|
||||
}
|
||||
|
||||
/// The one trailer worth showing, resolved by the §9.6 rule inside `arr-meta`.
|
||||
#[derive(Debug, Clone, Serialize, ToSchema)]
|
||||
pub struct MetadataTrailer {
|
||||
@@ -52,8 +40,6 @@ pub struct MovieMetadata {
|
||||
pub homepage: Option<String>,
|
||||
/// §9.6 links out to `IMDb` for movies.
|
||||
pub imdb_id: Option<String>,
|
||||
/// Top 10 billed, ordered by TMDB's own cast order.
|
||||
pub cast: Vec<MetadataCastMember>,
|
||||
pub trailer: Option<MetadataTrailer>,
|
||||
}
|
||||
|
||||
@@ -75,8 +61,6 @@ pub struct SeriesMetadata {
|
||||
pub homepage: Option<String>,
|
||||
/// §9.6 links out to TVDB for series.
|
||||
pub tvdb_id: Option<u32>,
|
||||
/// Top 10 billed, ordered by TMDB's own cast order.
|
||||
pub cast: Vec<MetadataCastMember>,
|
||||
pub trailer: Option<MetadataTrailer>,
|
||||
}
|
||||
|
||||
@@ -95,7 +79,6 @@ impl From<MovieDetail> for MovieMetadata {
|
||||
vote_count: detail.vote_count,
|
||||
homepage: detail.homepage,
|
||||
imdb_id: detail.imdb_id,
|
||||
cast: detail.cast.into_iter().map(Into::into).collect(),
|
||||
trailer: detail.trailer.map(Into::into),
|
||||
}
|
||||
}
|
||||
@@ -116,23 +99,11 @@ impl From<SeriesDetail> for SeriesMetadata {
|
||||
vote_count: detail.vote_count,
|
||||
homepage: detail.homepage,
|
||||
tvdb_id: detail.tvdb_id,
|
||||
cast: detail.cast.into_iter().map(Into::into).collect(),
|
||||
trailer: detail.trailer.map(Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<arr_meta::CastMember> for MetadataCastMember {
|
||||
fn from(member: arr_meta::CastMember) -> Self {
|
||||
Self {
|
||||
tmdb_id: member.tmdb_id,
|
||||
name: member.name,
|
||||
character: member.character,
|
||||
profile_path: member.profile_path,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<arr_meta::Video> for MetadataTrailer {
|
||||
fn from(video: arr_meta::Video) -> Self {
|
||||
Self {
|
||||
@@ -347,11 +318,6 @@ mod tests {
|
||||
// §9.6: path fragments exactly as TMDB sends them, never composed URLs.
|
||||
assert_eq!(body["poster_path"], "/1pdfLlvXA5qYN3ikFm4QDe7EJ19.jpg");
|
||||
assert_eq!(body["backdrop_path"], "/xOMo8BRK7PfcJv9JCnx7s5hj0PX.jpg");
|
||||
assert_eq!(
|
||||
body["cast"][0]["profile_path"],
|
||||
"/tzLq0VAm3myi2lzNpdfhVGjXAdB.jpg"
|
||||
);
|
||||
assert_eq!(body["cast"][0]["character"], "Paul Atreides");
|
||||
assert_eq!(body["trailer"]["youtube_key"], "Way9Dexny3w");
|
||||
tmdb.verify().await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user