Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.forked_daapd.browse_media Namespace Reference

Classes

class  MediaContent
 

Functions

BrowseMedia base_owntone_library ()
 
str convert_to_owntone_uri (str media_content_id)
 
BrowseMedia create_browse_media_response (media_player.ForkedDaapdMaster master, MediaContent media_content, list[dict[str, int|str]] result, list[BrowseMedia]|None children=None)
 
str create_media_content_id (str title, str owntone_uri="", str media_type="", str id_or_path="", str subtype="")
 
str create_owntone_uri (str media_type, str id_or_path)
 
BrowseMedia get_owntone_content (media_player.ForkedDaapdMaster master, str media_content_id)
 
bool is_owntone_media_content_id (str media_content_id)
 
BrowseMedia library (Sequence[BrowseMedia]|None other)
 

Variables

dictionary CAN_EXPAND_TYPE
 
string MEDIA_TYPE_DIRECTORY = "directory"
 
dictionary MEDIA_TYPE_TO_MEDIA_CLASS
 
dictionary MEDIA_TYPE_TO_OWNTONE_TYPE = {v: k for k, v in OWNTONE_TYPE_TO_MEDIA_TYPE.items()}
 
dictionary OWNTONE_TYPE_TO_MEDIA_TYPE
 
dictionary TOP_LEVEL_LIBRARY
 

Detailed Description

Browse media for forked-daapd.

Function Documentation

◆ base_owntone_library()

BrowseMedia homeassistant.components.forked_daapd.browse_media.base_owntone_library ( )
Return the base of our OwnTone library.

Definition at line 282 of file browse_media.py.

◆ convert_to_owntone_uri()

str homeassistant.components.forked_daapd.browse_media.convert_to_owntone_uri ( str  media_content_id)
Convert media_content_id to OwnTone URI.

Definition at line 120 of file browse_media.py.

◆ create_browse_media_response()

BrowseMedia homeassistant.components.forked_daapd.browse_media.create_browse_media_response ( media_player.ForkedDaapdMaster  master,
MediaContent  media_content,
list[dict[str, int | str]]  result,
list[BrowseMedia] | None   children = None 
)
Convert the results into a browse media response.

Definition at line 226 of file browse_media.py.

◆ create_media_content_id()

str homeassistant.components.forked_daapd.browse_media.create_media_content_id ( str  title,
str   owntone_uri = "",
str   media_type = "",
str   id_or_path = "",
str   subtype = "" 
)
Create a media_content_id.

Either owntone_uri or both type and id_or_path must be specified.

Definition at line 99 of file browse_media.py.

◆ create_owntone_uri()

str homeassistant.components.forked_daapd.browse_media.create_owntone_uri ( str  media_type,
str  id_or_path 
)
Create an OwnTone uri.

Definition at line 94 of file browse_media.py.

◆ get_owntone_content()

BrowseMedia homeassistant.components.forked_daapd.browse_media.get_owntone_content ( media_player.ForkedDaapdMaster  master,
str  media_content_id 
)
Create response for the given media_content_id.

Definition at line 125 of file browse_media.py.

◆ is_owntone_media_content_id()

bool homeassistant.components.forked_daapd.browse_media.is_owntone_media_content_id ( str  media_content_id)
Return whether this media_content_id is from our integration.

Definition at line 115 of file browse_media.py.

◆ library()

BrowseMedia homeassistant.components.forked_daapd.browse_media.library ( Sequence[BrowseMedia] | None  other)
Create response to describe contents of library.

Definition at line 311 of file browse_media.py.

Variable Documentation

◆ CAN_EXPAND_TYPE

dictionary homeassistant.components.forked_daapd.browse_media.CAN_EXPAND_TYPE
Initial value:
1 = {
2  MediaType.ALBUM,
3  MediaType.ARTIST,
4  MediaType.PLAYLIST,
5  MediaType.GENRE,
6  MEDIA_TYPE_DIRECTORY,
7 }

Definition at line 43 of file browse_media.py.

◆ MEDIA_TYPE_DIRECTORY

string homeassistant.components.forked_daapd.browse_media.MEDIA_TYPE_DIRECTORY = "directory"

Definition at line 23 of file browse_media.py.

◆ MEDIA_TYPE_TO_MEDIA_CLASS

dictionary homeassistant.components.forked_daapd.browse_media.MEDIA_TYPE_TO_MEDIA_CLASS
Initial value:
1 = {
2  MediaType.ALBUM: MediaClass.ALBUM,
3  MediaType.APP: MediaClass.APP,
4  MediaType.ARTIST: MediaClass.ARTIST,
5  MediaType.TRACK: MediaClass.TRACK,
6  MediaType.PLAYLIST: MediaClass.PLAYLIST,
7  MediaType.GENRE: MediaClass.GENRE,
8  MEDIA_TYPE_DIRECTORY: MediaClass.DIRECTORY,
9 }

Definition at line 34 of file browse_media.py.

◆ MEDIA_TYPE_TO_OWNTONE_TYPE

dictionary homeassistant.components.forked_daapd.browse_media.MEDIA_TYPE_TO_OWNTONE_TYPE = {v: k for k, v in OWNTONE_TYPE_TO_MEDIA_TYPE.items()}

Definition at line 61 of file browse_media.py.

◆ OWNTONE_TYPE_TO_MEDIA_TYPE

dictionary homeassistant.components.forked_daapd.browse_media.OWNTONE_TYPE_TO_MEDIA_TYPE
Initial value:
1 = {
2  "track": MediaType.TRACK,
3  "playlist": MediaType.PLAYLIST,
4  "artist": MediaType.ARTIST,
5  "album": MediaType.ALBUM,
6  "genre": MediaType.GENRE,
7  MediaType.APP: MediaType.APP, # This is just for passthrough
8  MEDIA_TYPE_DIRECTORY: MEDIA_TYPE_DIRECTORY, # This is just for passthrough
9 }

Definition at line 52 of file browse_media.py.

◆ TOP_LEVEL_LIBRARY

dictionary homeassistant.components.forked_daapd.browse_media.TOP_LEVEL_LIBRARY
Initial value:
1 = {
2  "Albums": (MediaClass.ALBUM, MediaType.ALBUM, ""),
3  "Artists": (MediaClass.ARTIST, MediaType.ARTIST, ""),
4  "Playlists": (MediaClass.PLAYLIST, MediaType.PLAYLIST, ""),
5  "Albums by Genre": (MediaClass.GENRE, MediaType.GENRE, MediaType.ALBUM),
6  "Tracks by Genre": (MediaClass.GENRE, MediaType.GENRE, MediaType.TRACK),
7  "Artists by Genre": (MediaClass.GENRE, MediaType.GENRE, MediaType.ARTIST),
8  "Directories": (MediaClass.DIRECTORY, MEDIA_TYPE_DIRECTORY, ""),
9 }

Definition at line 25 of file browse_media.py.