-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area: integrationsExternal service integrations (TMDB, RPDB)External service integrations (TMDB, RPDB)effort: largeMultiple daysMultiple dayspriority: lowNice to haveNice to havetype: tech-debtTechnical debt to addressTechnical debt to address
Description
Summary
External data from TMDB API, GitHub cache, and Xtream API is trusted without schema validation.
Current State
services/tmdb.tsusesas unknown ascastsservices/tmdb-exports.tstrusts GitHub cache structuredb/sync.tsparses Xtream API responses without validation
Proposed Solution
Add Zod schemas for external data:
import { z } from 'zod';
const TmdbMovieSchema = z.object({
id: z.number().positive(),
title: z.string().min(1),
release_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
vote_average: z.number().min(0).max(10),
});Benefits
- Graceful handling of malformed external data
- Clear error messages when APIs change
- Type-safe parsing
Notes
- Adds zod dependency
- Should implement incrementally per integration
- From PR feat(vod): Add Netflix-style Movies & Series pages with TMDB integration #6 review: type-design synthesis
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: integrationsExternal service integrations (TMDB, RPDB)External service integrations (TMDB, RPDB)effort: largeMultiple daysMultiple dayspriority: lowNice to haveNice to havetype: tech-debtTechnical debt to addressTechnical debt to address