feat: Simple people pages implementation

This commit is contained in:
Aleksi Lassila
2024-05-30 16:28:05 +03:00
parent 2a376bb0ef
commit 12edf92754
6 changed files with 141 additions and 10 deletions

View File

@@ -242,6 +242,34 @@ export class TmdbApi implements Api<paths> {
})
.then((res) => res.data?.results || []) || Promise.resolve([]);
getPerson = async (person_id: number) =>
this.getClient()
.GET('/3/person/{person_id}', {
params: {
path: {
person_id: person_id
},
query: {
append_to_response: 'images,movie_credits,tv_credits,external_ids'
}
}
})
.then((res) => res.data as TmdbPersonFull);
getPersonTaggedImages = async (person_id: number) =>
this.getClient()
?.GET('/3/person/{person_id}/tagged_images', {
params: {
path: {
person_id: person_id
}
}
})
.then((res) => res.data?.results || []) || Promise.resolve([]);
getPersonBackdrops = async (person_id: number) =>
this.getPersonTaggedImages(person_id).then((r) => r.filter((i) => (i.aspect_ratio || 0) > 1.5));
// OTHER
// USER