pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add getRelatedMedia tmdb.ts function

Pas 5cd63c2a cec7851d

+13
+13
src/backend/metadata/tmdb.ts
··· 436 436 return get<TMDBCredits>(`/${endpoint}/${id}/credits`); 437 437 } 438 438 439 + export async function getRelatedMedia( 440 + id: string, 441 + type: TMDBContentTypes, 442 + limit: number = 10, 443 + ): Promise<TMDBMovieSearchResult[] | TMDBShowSearchResult[]> { 444 + const endpoint = type === TMDBContentTypes.MOVIE ? "movie" : "tv"; 445 + const data = await get<{ 446 + results: TMDBMovieSearchResult[] | TMDBShowSearchResult[]; 447 + }>(`/${endpoint}/${id}/similar`); 448 + 449 + return data.results.slice(0, limit); 450 + } 451 + 439 452 export async function getPersonDetails(id: string): Promise<TMDBPerson> { 440 453 return get<TMDBPerson>(`/person/${id}`); 441 454 }