feat(api): resolve trailer chips by TMDB id

This commit is contained in:
Miguel Palhas
2026-08-23 22:03:04 +01:00
parent 9bd037d1b6
commit 80a63ea2e1
4 changed files with 215 additions and 1 deletions
+4
View File
@@ -149,6 +149,9 @@ pub enum ApiError {
OwnerNotFound,
PolicyNotFound,
RootNotFound,
/// The §9.6 chip outcome: the title exists upstream but has no trailer.
/// Ordinary, so it must stay distinguishable from an upstream failure.
NoTrailer,
Conflict(String),
Invalid(String),
Unavailable,
@@ -169,6 +172,7 @@ impl IntoResponse for ApiError {
Self::OwnerNotFound => (StatusCode::NOT_FOUND, "owner not found".to_string()),
Self::PolicyNotFound => (StatusCode::NOT_FOUND, "policy not found".to_string()),
Self::RootNotFound => (StatusCode::NOT_FOUND, "root not found".to_string()),
Self::NoTrailer => (StatusCode::NOT_FOUND, "no trailer".to_string()),
Self::Conflict(error) => (StatusCode::CONFLICT, error),
Self::Invalid(error) => (StatusCode::UNPROCESSABLE_ENTITY, error),
Self::Unavailable => (