{
  "$schema": "better-stream/metadata-provider-descriptor@2",
  "id": "tmdb1",
  "name": "FlixHarbor",
  "dedicatedCategory": "Catalog",
  "Type": "default",
  "label": "Catalog",
  "version": "1.0.5",
  "engine": "metaprovider",
  "description": "The Movie Database as a Better Stream metadata provider. Supplies Home, Movies, Series, Details, search, seasons, people, companies and networks - the same surface as the built-in TMDB provider, in declarative form.",
  "author": "FlixHarbor",
  "iconUrl": "https://catalog.flixharbor.com/apple-icon.png",
  "logo": "https://catalog.flixharbor.com/apple-icon.png",
  "keyLabel": "TMDB API key",
  "idPrefix": "tmdb:",
  "listPath": "results",
  "totalPagesPath": "total_pages",
  "ratedFloor": 200,
  "api": {
    "base": "https://catalog.flixharbor.com/api/v1",
    "image": "https://image.tmdb.org/t/p/",
    "auth": {
      "param": "api_key",
      "in": "query"
    }
  },
  "i18n": {
    "languageParam": "language",
    "regionParam": "region",
    "defaultLanguage": "en-US",
    "fallbackLanguage": "en-US"
  },
  "types": [
    "movie",
    "series"
  ],
  "typeMap": {
    "movie": "movie",
    "series": "tv"
  },
  "item": {
    "id": "id",
    "mediaType": "media_type",
    "seriesHint": [
      "first_air_date",
      "name"
    ],
    "title": [
      "title",
      "name",
      "original_title",
      "original_name"
    ],
    "date": [
      "release_date",
      "first_air_date"
    ],
    "poster": "poster_path",
    "posterSize": "w500",
    "backdrop": "backdrop_path",
    "description": "overview",
    "rating": "vote_average",
    "votes": "vote_count",
    "popularity": "popularity",
    "originalLanguage": "original_language",
    "genreIds": "genre_ids",
    "runtime": "runtime"
  },
  "endpoints": {
    "genres": {
      "path": "/genre/{type}/list",
      "listPath": "genres",
      "id": "id",
      "name": "name"
    },
    "discover": {
      "path": "/discover/{type}",
      "defaultSort": "popularity.desc",
      "params": {
        "sort": "sort_by",
        "genres": "with_genres",
        "excludeGenres": "without_genres",
        "minRating": "vote_average.gte",
        "minVotes": "vote_count.gte",
        "originalLanguage": "with_original_language",
        "runtimeGte": "with_runtime.gte",
        "adult": "include_adult",
        "yearMovie": "primary_release_year",
        "yearSeries": "first_air_date_year",
        "company": "with_companies",
        "network": "with_networks",
        "watchProvider": "with_watch_providers",
        "watchRegion": "watch_region",
        "cast": "with_cast",
        "crew": "with_crew",
        "people": "with_people",
        "keywords": "with_keywords"
      }
    },
    "search": {
      "path": "/search/multi",
      "typedPath": "/search/{type}",
      "queryParam": "query",
      "extra": {
        "include_adult": "false"
      }
    },
    "details": {
      "path": "/{type}/{id}",
      "appendParam": "append_to_response",
      "append": "credits,videos,external_ids,recommendations,translations",
      "genres": "genres",
      "runtime": [
        "runtime",
        "episode_run_time.0"
      ],
      "backdrop": "backdrop_path",
      "backdropSize": "w1280",
      "seasons": "seasons",
      "cast": "credits.cast",
      "videos": "videos.results",
      "videoUrl": "https://www.youtube.com/watch?v={key}",
      "similar": "recommendations.results",
      "externalFields": {
        "imdb": "external_ids.imdb_id",
        "tvdb": "external_ids.tvdb_id"
      },
      "appendFromI18n": true
    },
    "season": {
      "path": "/tv/{id}/season/{season}",
      "listPath": "episodes",
      "season": "season_number",
      "episode": "episode_number",
      "title": "name",
      "overview": "overview",
      "still": "still_path",
      "stillSize": "w300",
      "date": "air_date",
      "runtime": "runtime"
    },
    "similar": {
      "path": "/{type}/{id}/recommendations"
    },
    "externalIds": {
      "path": "/{type}/{id}/external_ids",
      "fields": {
        "imdb": "imdb_id",
        "tvdb": "tvdb_id"
      }
    },
    "person": {
      "path": "/person/{id}",
      "appendParam": "append_to_response",
      "append": "combined_credits,external_ids",
      "name": "name",
      "biography": "biography",
      "photo": "profile_path",
      "photoSize": "w300",
      "castPath": "combined_credits.cast",
      "crewPath": "combined_credits.crew",
      "photoLargeSize": "h632",
      "externalFields": {
        "imdb": "external_ids.imdb_id",
        "instagram": "external_ids.instagram_id",
        "twitter": "external_ids.twitter_id",
        "facebook": "external_ids.facebook_id",
        "tiktok": "external_ids.tiktok_id"
      }
    },
    "company": {
      "path": "/company/{id}"
    },
    "network": {
      "path": "/network/{id}"
    },
    "credits": {
      "path": "/{type}/{id}/credits",
      "cast": "cast",
      "crew": "crew"
    }
  },
  "sections": {
    "popular_movies": {
      "kind": "movie",
      "discover": {
        "sort": "popularity.desc"
      }
    },
    "top_rated_movies": {
      "kind": "movie",
      "discover": {
        "sort": "vote_average.desc",
        "minVotes": "{minVotes}"
      }
    },
    "now_playing": {
      "kind": "movie",
      "discover": {
        "sort": "popularity.desc",
        "primary_release_date.gte": "{recent}",
        "primary_release_date.lte": "{today}"
      }
    },
    "upcoming": {
      "kind": "movie",
      "discover": {
        "sort": "popularity.desc",
        "primary_release_date.gte": "{today}"
      }
    },
    "popular_tv": {
      "kind": "series",
      "discover": {
        "sort": "popularity.desc"
      }
    },
    "top_rated_tv": {
      "kind": "series",
      "discover": {
        "sort": "vote_average.desc",
        "minVotes": "{minVotes}"
      }
    },
    "on_the_air": {
      "kind": "series",
      "discover": {
        "sort": "popularity.desc",
        "air_date.gte": "{today}",
        "air_date.lte": "{soon}"
      }
    },
    "airing_today": {
      "kind": "series",
      "discover": {
        "sort": "popularity.desc",
        "air_date.gte": "{today}",
        "air_date.lte": "{today}"
      }
    },
    "trending_movie_day": {
      "kind": "movie",
      "endpoint": "/trending/movie/day"
    },
    "trending_movie_week": {
      "kind": "movie",
      "endpoint": "/trending/movie/week"
    },
    "trending_tv_day": {
      "kind": "series",
      "endpoint": "/trending/tv/day"
    },
    "trending_tv_week": {
      "kind": "series",
      "endpoint": "/trending/tv/week"
    },
    "trending_all_day": {
      "kind": "movie",
      "endpoint": "/trending/all/day",
      "mixed": true
    }
  },
  "sectionPatterns": [
    {
      "match": "^genre_movie_(\\d+)$",
      "kind": "movie",
      "discover": {
        "with_genres": "$1",
        "sort": "popularity.desc"
      }
    },
    {
      "match": "^genre_tv_(\\d+)$",
      "kind": "series",
      "discover": {
        "with_genres": "$1",
        "sort": "popularity.desc"
      }
    },
    {
      "match": "^lang_movie_([a-z]{2})$",
      "kind": "movie",
      "discover": {
        "with_original_language": "$1",
        "sort": "popularity.desc"
      }
    },
    {
      "match": "^lang_tv_([a-z]{2})$",
      "kind": "series",
      "discover": {
        "with_original_language": "$1",
        "sort": "popularity.desc"
      }
    }
  ],
  "home": {
    "movie": [
      {
        "title": "Trending movies",
        "section": "trending_movie_day"
      },
      {
        "title": "Popular movies",
        "section": "popular_movies"
      },
      {
        "title": "Now playing",
        "section": "now_playing"
      },
      {
        "title": "Top rated movies",
        "section": "top_rated_movies"
      },
      {
        "title": "Upcoming",
        "section": "upcoming"
      }
    ],
    "series": [
      {
        "title": "Trending series",
        "section": "trending_tv_day"
      },
      {
        "title": "Popular series",
        "section": "popular_tv"
      },
      {
        "title": "Airing today",
        "section": "airing_today"
      },
      {
        "title": "Top rated series",
        "section": "top_rated_tv"
      },
      {
        "title": "On the air",
        "section": "on_the_air"
      }
    ],
    "all": [
      {
        "title": "Trending today",
        "section": "trending_all_day"
      },
      {
        "title": "Popular movies",
        "section": "popular_movies"
      },
      {
        "title": "Popular TV",
        "section": "popular_tv"
      },
      {
        "title": "Top rated movies",
        "section": "top_rated_movies"
      }
    ]
  },
  "responseShape": "tmdb",
  "config": [
    {
      "key": "apiKey",
      "type": "password",
      "title": "API key",
      "required": true,
      "description": "Your key for this API. Stored locally and sent only to the base URL below."
    },
    {
      "key": "baseUrl",
      "type": "text",
      "title": "API base URL",
      "required": false,
      "description": "Override the API address - point this at your own TMDB-compatible server. Leave blank to use the default."
    },
    {
      "key": "imageBase",
      "type": "text",
      "title": "Image base URL",
      "required": false,
      "description": "Override where poster and backdrop images are loaded from. Leave blank to use the default."
    }
  ],
  "resources": [
    "catalog",
    "meta"
  ]
}