feat: allow changing YouTube host for trailers (#643)

* feat(server settings, movie/tv/settings components): allow changing YouTube URL for trailers

* fix: add i18n messages

* fix(i18n): remove unwanted translation change

---------

Co-authored-by: Gauthier <mail@gauthierth.fr>
This commit is contained in:
Danish Humair
2025-05-07 19:32:15 +05:00
committed by GitHub
parent c55da3da5f
commit d01f9a0580
8 changed files with 58 additions and 5 deletions

View File

@@ -208,10 +208,15 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
});
}
const trailerUrl = data.relatedVideos
const trailerVideo = data.relatedVideos
?.filter((r) => r.type === 'Trailer')
.sort((a, b) => a.size - b.size)
.pop()?.url;
.pop();
const trailerUrl =
trailerVideo?.site === 'YouTube' &&
settings.currentSettings.youtubeUrl != ''
? `${settings.currentSettings.youtubeUrl}${trailerVideo?.key}`
: trailerVideo?.url;
if (trailerUrl) {
mediaLinks.push({