# Catalog Fallback Chain Verification (2026-05-22)

## Quick Health Check

```bash
# 1. Worker health
curl -s https://nexstream-catalog.tw24fr.workers.dev/v1/health
# → {"ok":true,"service":"nexstream-catalog","version":"1"}

# 2. Worker catalog (trending movies)
curl -s "https://nexstream-catalog.tw24fr.workers.dev/v1/catalog/movie/tmdb.trending_week?skip=0&limit=3"
# → Returns 20 movies with posters, ratings, genres, descriptions

# 3. Worker search
curl -s "https://nexstream-catalog.tw24fr.workers.dev/v1/catalog/movie/tmdb.search?search=inception&limit=3"
# → Returns empty items (search not yet supported by worker — falls through to TMDB)
```

## 3-Tier Fallback Chain (AddonRepository.getCatalogRows)

1. **Catalog Worker** (`NexStreamCatalogRepository`) — default, always tried first. Server-side TMDB keys.
2. **TMDB Direct** (`TmdbCatalogRepository`) — local API key fallback. Supports: trending, popular, top_rated, now_playing, upcoming, airing_today, on_the_air, discover (genre, OTT), search (via searchMulti).
3. **Stremio Addons** — user-optional community catalog addons. Last resort.

## Diagnosing Empty Catalog Screens

1. Check worker health (if down, all falls to Tier 2)
2. Check TMDB API key is configured (`local.properties` → `tmdbApiKey`)
3. Check `TmdbCatalogRepository.getCatalogRowInternal()` supports the catalog ID being requested
4. Check NoTorrent/Torrentio addon status in Addons screen
5. Verify `AddonRepository.initialize()` was called (HomeViewModel.loadHome() does this)

## Common Catalog IDs

| ID | Description | Worker | TMDB | Stremio |
|----|-------------|--------|------|---------|
| `tmdb.trending` | Trending movies/shows | ✓ | ✓ | ✓ |
| `tmdb.popular` | Popular | ✓ | ✓ | ✓ |
| `tmdb.top_rated` | Top rated | ✓ | ✓ | ✓ |
| `tmdb.now_playing` | Now playing movies | ✓ | ✓ | ✓ |
| `tmdb.upcoming` | Upcoming movies | ✓ | ✓ | ✓ |
| `tmdb.airing_today` | Airing today TV | ✓ | ✓ | ✓ |
| `tmdb.on_the_air` | On the air TV | ✓ | ✓ | ✓ |
| `tmdb.search` | Search (needs `extra["search"]`) | ✗ | ✓ | ✓ |
| `tmdb.top` | Discover top (genre filter) | ✓ | ✓ | ✓ |
| `tmdb.ott.*` | OTT platform rows | ✓ | ✓ | ✓ |
