This document provides detailed descriptions of the functions implemented in the Movie and Series Information Service.
- Description: Fetches the list of movie genres from TMDB.
- Returns: Array of genres.
- Description: Fetches a random page of movies sorted by popularity.
- Returns: JSON object containing a list of movies.
- Description: Parses the raw movie data to extract essential fields.
- Parameters:
data
: Raw movie data from TMDB.
- Returns: Array of parsed movie objects.
- Description: Categorizes movies by their genres.
- Parameters:
movies
: Array of movies with genre IDs.
- Returns: Object mapping genres to arrays of movies.
- Description: Fetches the list of series genres from TMDB.
- Returns: Array of genres.
- Description: Fetches a random page of series sorted by original language and popularity.
- Returns: JSON object containing a list of series.
- Description: Parses the raw series data to extract essential fields.
- Parameters:
data
: Raw series data from TMDB.
- Returns: Array of parsed series objects.
- Description: Calculates the percentage of each genre based on count.
- Parameters:
genreData
: Array of genres with their count.
- Returns: Array of genres with percentage calculations.
- Description: Allocates a specific number of movie slots based on genre popularity.
- Parameters:
genrePercentages
: Array of genres with their calculated percentages.totalSlots
: Total slots available for movies.
- Returns: Array of movies selected based on the allocated slots.
- Description: Selects the top categories based on count.
- Parameters:
data
: Array of category data.numCategories
: Number of top categories to select.
- Returns: Array of top categories.