tmdb_helper

Code.tmdb_helper.get_tmdb_id_from_collection(search_query)[source]

Search for a collection by name.

Use the builtin Plex tmdb api service to search for a tmdb collection by name.

Parameters:
search_query : str

Name of collection to search for.

Returns:
Optional[int]

Return collection ID if found, otherwise None.

Examples

>>> get_tmdb_id_from_collection(search_query='James Bond Collection')
645
>>> get_tmdb_id_from_collection(search_query='James Bond')
645
Code.tmdb_helper.get_tmdb_id_from_external_id(external_id, database, item_type)[source]

Convert IMDB ID to TMDB ID.

Use the builtin Plex tmdb api service to search for a movie by IMDB ID.

Parameters:
external_id : Union[int, str]

External ID to convert.

database : str

Database to search. Must be one of ‘imdb’ or ‘tvdb’.

item_type : str

Item type to search. Must be one of ‘movie’ or ‘tv’.

Returns:
Optional[int]

Return TMDB ID if found, otherwise None.

Examples

>>> get_tmdb_id_from_external_id(imdb_id='tt1254207', database='imdb', item_type='movie')
10378
>>> get_tmdb_id_from_external_id(imdb_id='268592', database='tvdb', item_type='tv')
48866