updated getTrending
This commit is contained in:
1 parent
25f0fc3b81
commit
bcf1cd3cec
1 file changed
+6
-2
@@ -38,9 +38,13 @@ export class TmdbService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTrending(page: number, isMovie: boolean): Observable<Entry[]> {
|
getTrending(
|
||||||
|
page: number,
|
||||||
|
isMovie: boolean,
|
||||||
|
period: string
|
||||||
|
): Observable<Entry[]> {
|
||||||
var type = isMovie ? 'movie' : 'tv';
|
var type = isMovie ? 'movie' : 'tv';
|
||||||
var endPoint = `${this.tmdb_apiUrl}/trending/${type}/day?api_key=${this.tmdb_apiKey}&language=en-US`;
|
var endPoint = `${this.tmdb_apiUrl}/trending/${type}/${period}?page=${page}&api_key=${this.tmdb_apiKey}&language=en-US`;
|
||||||
|
|
||||||
return this.fetchdata(endPoint).pipe(
|
return this.fetchdata(endPoint).pipe(
|
||||||
map((response) =>
|
map((response) =>
|
||||||
|
|||||||
Reference in new issue
Block a user