Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.plex.media_search Namespace Reference

Functions

PlexObject|list[PlexObject] search_media (str media_type, LibrarySection library_section, bool allow_multiple=False, **kwargs)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary LEGACY_PARAM_MAPPING
 
tuple PREFERRED_LIBTYPE_ORDER
 

Detailed Description

Helper methods to search for Plex media.

Function Documentation

◆ search_media()

PlexObject | list[PlexObject] homeassistant.components.plex.media_search.search_media ( str  media_type,
LibrarySection  library_section,
bool   allow_multiple = False,
**  kwargs 
)
Search for specified Plex media in the provided library section.

Returns a media item or a list of items if `allow_multiple` is set.

Raises MediaNotFound if the search was unsuccessful.

Definition at line 38 of file media_search.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.plex.media_search._LOGGER = logging.getLogger(__name__)
private

Definition at line 35 of file media_search.py.

◆ LEGACY_PARAM_MAPPING

dictionary homeassistant.components.plex.media_search.LEGACY_PARAM_MAPPING
Initial value:
1 = {
2  "show_name": "show.title",
3  "season_number": "season.index",
4  "episode_name": "episode.title",
5  "episode_number": "episode.index",
6  "artist_name": "artist.title",
7  "album_name": "album.title",
8  "track_name": "track.title",
9  "track_number": "track.index",
10  "video_name": "movie.title",
11 }

Definition at line 13 of file media_search.py.

◆ PREFERRED_LIBTYPE_ORDER

tuple homeassistant.components.plex.media_search.PREFERRED_LIBTYPE_ORDER
Initial value:
1 = (
2  "episode",
3  "season",
4  "show",
5  "track",
6  "album",
7  "artist",
8 )

Definition at line 25 of file media_search.py.