mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
Update AppleTVHero.tsx
This commit is contained in:
parent
8d50959abd
commit
c6c27bf86a
1 changed files with 2 additions and 3 deletions
|
|
@ -460,7 +460,7 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
|
||||||
// Fetch video list from TMDB to get the YouTube video ID
|
// Fetch video list from TMDB to get the YouTube video ID
|
||||||
const tmdbApiKey = await TMDBService.getInstance().getApiKey();
|
const tmdbApiKey = await TMDBService.getInstance().getApiKey();
|
||||||
const videosRes = await fetch(
|
const videosRes = await fetch(
|
||||||
`https://api.themoviedb.org/3/${contentType}/${tmdbId}/videos?api_key=${tmdbApiKey}`
|
`https://api.themoviedb.org/3/${contentType}/${tmdbId}/videos?api_key=${tmdbApiKey}&language=en-US`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!alive) return;
|
if (!alive) return;
|
||||||
|
|
@ -475,9 +475,8 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
|
||||||
const videosData = await videosRes.json();
|
const videosData = await videosRes.json();
|
||||||
const results: any[] = videosData.results ?? [];
|
const results: any[] = videosData.results ?? [];
|
||||||
|
|
||||||
// Pick best YouTube trailer: official trailer > any trailer > teaser > any YouTube video
|
// Pick best YouTube trailer: any trailer > teaser > any YouTube video
|
||||||
const pick =
|
const pick =
|
||||||
results.find((v) => v.site === 'YouTube' && v.type === 'Trailer' && v.official) ??
|
|
||||||
results.find((v) => v.site === 'YouTube' && v.type === 'Trailer') ??
|
results.find((v) => v.site === 'YouTube' && v.type === 'Trailer') ??
|
||||||
results.find((v) => v.site === 'YouTube' && v.type === 'Teaser') ??
|
results.find((v) => v.site === 'YouTube' && v.type === 'Teaser') ??
|
||||||
results.find((v) => v.site === 'YouTube');
|
results.find((v) => v.site === 'YouTube');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue