feat(api): series, season and episode endpoints (#81)
ci / web (push) Successful in 26s
e2e / e2e (push) Successful in 47s
ci / rust (push) Successful in 2m39s

This commit was merged in pull request #81.
This commit is contained in:
2026-08-22 23:02:34 +01:00
parent e650a762f9
commit d3cea8693b
34 changed files with 2762 additions and 21 deletions
+7 -1
View File
@@ -85,6 +85,9 @@ pub struct ErrorBody {
#[derive(Debug)]
pub enum ApiError {
NotFound,
SeriesNotFound,
SeasonNotFound,
EpisodeNotFound,
OwnerNotFound,
Conflict(String),
Invalid(String),
@@ -96,6 +99,9 @@ impl IntoResponse for ApiError {
fn into_response(self) -> Response {
let (status, error) = match self {
Self::NotFound => (StatusCode::NOT_FOUND, "movie not found".to_string()),
Self::SeriesNotFound => (StatusCode::NOT_FOUND, "series not found".to_string()),
Self::SeasonNotFound => (StatusCode::NOT_FOUND, "season not found".to_string()),
Self::EpisodeNotFound => (StatusCode::NOT_FOUND, "episode not found".to_string()),
Self::OwnerNotFound => (StatusCode::NOT_FOUND, "owner not found".to_string()),
Self::Conflict(error) => (StatusCode::CONFLICT, error),
Self::Invalid(error) => (StatusCode::UNPROCESSABLE_ENTITY, error),
@@ -104,7 +110,7 @@ impl IntoResponse for ApiError {
"database unavailable".into(),
),
Self::Database(error) => {
tracing::error!(%error, "movie API database error");
tracing::error!(%error, "API database error");
(StatusCode::INTERNAL_SERVER_ERROR, "database error".into())
}
};