searchmedia
Find playable files by name: music/tv-show/movie, drilled to leaf files with paging (limit/offset) and a total count. For music, title means the ALBUM name; match a song by its own title with the song arg ("play Hey Jude" needs no…
Instructions
Find playable files by name: music/tv-show/movie, drilled to leaf files with paging (limit/offset) and a total count. For music, title means the ALBUM name; match a song by its own title with the song arg ("play Hey Jude" needs no artist). Find a tv episode by its own name with the episodetitle arg. Movie and tv-show queries can also filter by actor/director. Finds media items only — for people lookups (bands, artists, who is in the library) use contributors. Returns { "type", "total", "returned", "offset", "truncated", "rows": [ { "file", "id", "label", "title", … } ] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| song | No | Music only: song title (substring, case-insensitive). Matches songs by their OWN name library-wide — the way to find a track without its album; narrow with artist/title(album)/number. Rows carry no resolved container. | |
| type | Yes | Media kind to search: music | tv-show | movie. | |
| actor | No | movie/tv-show only: cast-member name (substring, case-insensitive). For tv-show it matches episode cast, which includes guest stars; combinable with title. | |
| count | No | When true, return only the total match count (zero rows) — a cheap count. | |
| limit | No | Max leaf rows to return (default 50, max 500). Page with offset. | |
| title | No | Container/title to match (substring, case-insensitive): album for music (a song's own title is the separate `song` arg), show for tv-show, the movie title for movie. tv-show needs title, actor or director; without title the person is matched library-wide and rows carry showtitle. Music without artist resolves the album library-wide. | |
| artist | No | Music only: performer name (substring, case-insensitive). Resolves the artist; music needs artist, title or song. | |
| number | No | Position within the container: track number (music) or episode number (tv-show) — for an episode's title use episodetitle. | |
| offset | No | Number of leaf rows to skip — paginate together with limit. | |
| season | No | tv-show only: season number to narrow the episodes. | |
| director | No | movie/tv-show only: director name (substring, case-insensitive). For tv-show it matches per-episode directors; combinable with title. | |
| instance | No | Target Kodi instance. Omitted uses the default ("(null)"). | |
| episodetitle | No | tv-show only: an episode's OWN title (substring, case-insensitive) — the way to find an episode by name. Matched library-wide (rows carry showtitle) unless a show title also narrows it. This is the title, NOT the episode number (use number for that). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The matching leaf rows, paged. | |
| type | Yes | The searched media type, echoed back. | |
| total | Yes | Full match count, before any paging. | |
| offset | Yes | Rows skipped before this page. | |
| resolved | No | The container the query resolved to — { "artist"?|"show"?, "artistid"|"tvshowid" } — when it drilled through one. | |
| returned | Yes | Rows in this page. | |
| truncated | Yes | Whether matches remain beyond this page. | |
| approximate | No | Present (true) when total/paging are app-side estimates (a substring title matched several albums). |