getTvDetails method

Future<TvDetails> getTvDetails({
  1. required int tvId,
})

Get TV Details

Get the primary TV show details by id.

Other details like account_states, aggregate_credits, alternative_titles, content_ratings, credits, episode_groups, external_ids, images, keywords, recommendations, reviews, screened_theatrically, similar, translations, and videos.

For more details on the API go here.

Throws FilmGyaanException on an error.

Implementation

Future<TvDetails> getTvDetails({
  required int tvId,
}) async {
  Ensure(tvId > 0).isTrue('Tv Id should be > 0');

  var params = TvDetailsParams(
    tvId: tvId,
  );

  _logger.info('Getting tv details for $tvId');

  return defaultFlow<TvDetailsParams, TvDetails>(
    core: this,
    params: params,
    serializer: (dynamic json) => TvDetails.fromMap(
      json as Map<String, dynamic>,
    ),
  );
}